相思资源网 Design By www.200059.com
'原来用VB写的封装成dll供asp使用,后来升级到vb.net
'这个是我以前写的电影站影片处理的一部份,程序挺简单的,没怎么注释,大家对付看
'program by someeyes
'需要声明Imports System.IO命名空间
Public Function myFileExists(ByVal pathName As String) As String '检查文件是否存在
If File.Exists(pathName) = False Then
myFileExists = "<font color=""Red"">文件丢失</font>"
Else
myFileExists = "<font color=""#0066ff"">文件存在</font>"
End If
End Function
Private sub myCreatDirectory(ByVal pathName As String) '创建文件夹
Try
If Directory.Exists(pathName) = False Then
Directory.CreateDirectory(pathName)
End If
Catch e As Exception
myErrMsg = myErrMsg & "创建" & pathName & "文件夹的时候出现一个意外的错误."
myErrMsg = myErrMsg & e.ToString
HttpContext.Current.Response.Write("程序遇到一个意外的错误,详细情况请查看日志文件!<br>")
End Try
End Sub
Private Sub myDelDirectory(ByVal pathName As String) '删除文件夹
Try
If Directory.Exists(pathName) = True Then
Directory.Delete(pathName)
End If
Catch e As Exception
myErrMsg = myErrMsg & "删除" & pathName & "文件夹的时候出现一个意外的错误."
myErrMsg = myErrMsg & e.ToString
HttpContext.Current.Response.Write("程序遇到一个意外的错误,详细情况请查看日志文件!<br>")
End Try
End Sub
Private Sub myMoveFile(ByVal pathName As String, ByVal target As String) '移动文件夹
Try
File.Move(pathName, target)
Catch e As Exception
myErrMsg = myErrMsg & "从" & pathName & "移动文件到" & target & "的时候出现一个意外的错误."
myErrMsg = myErrMsg & e.ToString
HttpContext.Current.Response.Write("程序遇到一个意外的错误,详细情况请查看日志文件!<br>")
End Try
End Sub
Private Sub myCopyFile(ByVal fsource As String, ByVal fdestination As String)
Try
File.Copy(fsource, fdestination, False)
Catch e As Exception
myErrMsg = myErrMsg & "从" & fsource & "复制文件到" & fdestination & "的时候出现一个意外的错误."
myErrMsg = myErrMsg & e.ToString
HttpContext.Current.Response.Write("程序遇到一个意外的错误,详细情况请查看日志文件!<br>")
End Try
End Sub
'这个是我以前写的电影站影片处理的一部份,程序挺简单的,没怎么注释,大家对付看
'program by someeyes
'需要声明Imports System.IO命名空间
Public Function myFileExists(ByVal pathName As String) As String '检查文件是否存在
If File.Exists(pathName) = False Then
myFileExists = "<font color=""Red"">文件丢失</font>"
Else
myFileExists = "<font color=""#0066ff"">文件存在</font>"
End If
End Function
Private sub myCreatDirectory(ByVal pathName As String) '创建文件夹
Try
If Directory.Exists(pathName) = False Then
Directory.CreateDirectory(pathName)
End If
Catch e As Exception
myErrMsg = myErrMsg & "创建" & pathName & "文件夹的时候出现一个意外的错误."
myErrMsg = myErrMsg & e.ToString
HttpContext.Current.Response.Write("程序遇到一个意外的错误,详细情况请查看日志文件!<br>")
End Try
End Sub
Private Sub myDelDirectory(ByVal pathName As String) '删除文件夹
Try
If Directory.Exists(pathName) = True Then
Directory.Delete(pathName)
End If
Catch e As Exception
myErrMsg = myErrMsg & "删除" & pathName & "文件夹的时候出现一个意外的错误."
myErrMsg = myErrMsg & e.ToString
HttpContext.Current.Response.Write("程序遇到一个意外的错误,详细情况请查看日志文件!<br>")
End Try
End Sub
Private Sub myMoveFile(ByVal pathName As String, ByVal target As String) '移动文件夹
Try
File.Move(pathName, target)
Catch e As Exception
myErrMsg = myErrMsg & "从" & pathName & "移动文件到" & target & "的时候出现一个意外的错误."
myErrMsg = myErrMsg & e.ToString
HttpContext.Current.Response.Write("程序遇到一个意外的错误,详细情况请查看日志文件!<br>")
End Try
End Sub
Private Sub myCopyFile(ByVal fsource As String, ByVal fdestination As String)
Try
File.Copy(fsource, fdestination, False)
Catch e As Exception
myErrMsg = myErrMsg & "从" & fsource & "复制文件到" & fdestination & "的时候出现一个意外的错误."
myErrMsg = myErrMsg & e.ToString
HttpContext.Current.Response.Write("程序遇到一个意外的错误,详细情况请查看日志文件!<br>")
End Try
End Sub
相思资源网 Design By www.200059.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
相思资源网 Design By www.200059.com
暂无自己写的文件操作的function和Sub vb.net dll的评论...