最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

自己寫的文件操作的function和Sub vb.net dll

 更新時間:2007年08月30日 10:24:09   作者:  
'原來用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) '創(chuàng)建文件夾
        Try
            If Directory.Exists(pathName) = False Then
                Directory.CreateDirectory(pathName)
            End If
        Catch e As Exception
            myErrMsg = myErrMsg & "創(chuàng)建" & 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

相關文章

最新評論

大新县| 武强县| 宜春市| 溧阳市| 深州市| 通道| 长宁区| 福贡县| 汽车| 武川县| 常德市| 大邑县| 房产| 盖州市| 龙海市| 上蔡县| 全南县| 遵义县| 罗江县| 新宁县| 荥阳市| 保靖县| 霍邱县| 泰兴市| 尤溪县| 汤阴县| 红安县| 寿阳县| 绥德县| 翁源县| 格尔木市| 临西县| 成都市| 定陶县| 姚安县| 昌平区| 颍上县| 彭州市| 交城县| 闻喜县| 平顶山市|