关闭

Asp.Net 整理(文件)

1053人阅读 评论(0) 收藏 举报

        'Dim strPath As String = "C:/Inetpub/wwwroot/MyTest/abc"
        ''新建 文件夹
        ''If Not System.IO.Directory.Exists(strPath) Then
        ''    System.IO.Directory.CreateDirectory(strPath)
        ''End If

        ''删除文件夹(空)
        ''If System.IO.Directory.Exists(strPath) = True Then
        ''    System.IO.Directory.Delete(strPath)
        ''End If

        '取得一个目录里的所有文件夹
        'Dim strPath As String = "C:/Inetpub/wwwroot/MyTest"

        'Dim str() As String = System.IO.Directory.GetDirectories(strPath)

        '取得一个目录下的所有文件名
        'Dim strPath As String = "C:/Inetpub/wwwroot/MyTest"
        'Dim str() As String = System.IO.Directory.GetFiles(strPath)
  

        '删除文件
        'Dim strPath As String = "C:/Inetpub/wwwroot/MyTest/Class1.vb"
        'System.IO.File.Delete(strPath)

        '新建txt文件
        'Dim strPath2 As String = "C:/Inetpub/wwwroot/MyTest/abc/Class1.txt"
        'System.IO.File.Create(strPath2)

        'Dim strPath3 As String = "C:/Inetpub/wwwroot/MyTest/123"
        'Dim strPath As String = "C:/Inetpub/wwwroot/MyTest/abcd"

        'Dim strPath4 As String = "C:/Inetpub/wwwroot/MyTest/abc"

        'Dim oDisk As System.IO.Directory
        '文件夹改名
        'oDisk.Move(strPath3, strPath)

        '删除文件以及文件夹里的内容
        'oDisk.Delete(strPath4, True)

        '得到一个目录下的所有.inf文件s
        'System.IO.Directory.GetFiles(strDecompressFileName, "*.inf")

        '向文件里写数据
        'Dim sWrite As StreamWriter = New StreamWriter("abc.txt")
        'Dim m, n As Integer
        'For m = 0 To dtProjectData.Rows.Count - 1
        '    If dtProjectData.Rows(m)(1) <> "0" Then
        '        For n = 0 To dtProjectData.Columns.Count - 1
        '            sWrite.Write(dtProjectData.Rows(m)(n) & "    ")
        '        Next
        '        sWrite.WriteLine()
        '    End If
        'Next
        'sWrite.Close()

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:49207次
    • 积分:781
    • 等级:
    • 排名:千里之外
    • 原创:26篇
    • 转载:3篇
    • 译文:0篇
    • 评论:12条
    文章分类
    最新评论