'原来用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
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
桃源资源网 Design By www.nqtax.com
暂无“自己写的文件操作的function和Sub vb.net dll”评论...
RTX 5090要首发 性能要翻倍!三星展示GDDR7显存
三星在GTC上展示了专为下一代游戏GPU设计的GDDR7内存。
首次推出的GDDR7内存模块密度为16GB,每个模块容量为2GB。其速度预设为32 Gbps(PAM3),但也可以降至28 Gbps,以提高产量和初始阶段的整体性能和成本效益。
据三星表示,GDDR7内存的能效将提高20%,同时工作电压仅为1.1V,低于标准的1.2V。通过采用更新的封装材料和优化的电路设计,使得在高速运行时的发热量降低,GDDR7的热阻比GDDR6降低了70%。