日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時(shí)間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
VB.NET文件夾操作相關(guān)技巧分享

編程人員利用VB.NET進(jìn)行實(shí)際編程,可以輕松簡便的完成各種功能。比如今天為大家介紹的VB.NET在對(duì)文件夾的操作上,就可以輕松的實(shí)現(xiàn)各種操作。下面就讓我們一起來看看VB.NET文件夾操作相關(guān)應(yīng)用技巧。

成都創(chuàng)新互聯(lián)公司堅(jiān)持“要么做到,要么別承諾”的工作理念,服務(wù)領(lǐng)域包括:成都網(wǎng)站設(shè)計(jì)、成都網(wǎng)站建設(shè)、企業(yè)官網(wǎng)、英文網(wǎng)站、手機(jī)端網(wǎng)站、網(wǎng)站推廣等服務(wù),滿足客戶于互聯(lián)網(wǎng)時(shí)代的保靖網(wǎng)站設(shè)計(jì)、移動(dòng)媒體設(shè)計(jì)的需求,幫助企業(yè)找到有效的互聯(lián)網(wǎng)解決方案。努力成為您成熟可靠的網(wǎng)絡(luò)建設(shè)合作伙伴!

VB.NET文件夾操作之文件夾復(fù)制

 
 
 
  1. Function CopyDir()Function CopyDir
    (ByVal sourcePath As String, ByVal 
    targetPath As String) As Boolean  
  2. Try  
  3. '檢查目標(biāo)目錄是否以目錄分割字符結(jié)束,
    不是則添加  
  4. If Right(targetPath, 1) <> ""
     Then targetPath += ""  
  5. '判斷目標(biāo)目錄是否存在,不存在則新建  
  6. If Not Directory.Exists(targetPath)
     Then Directory.CreateDirectory
    (targetPath)  
  7. ' 得到源目錄的文件列表,該里面是包含
    文件以及目錄路徑的一個(gè)數(shù)組  
  8. Dim fileList As String() = 
    Directory.GetFileSystemEntries
    (sourcePath)  
  9. '遍歷所有的文件和目錄  
  10. For Each filepath As String In 
    fileList  
  11. '目錄處理,遞歸  
  12. If (Directory.Exists(filepath)) Then  
  13. CopyDir(filepath, targetPath + 
    Path.GetFileName(filepath))  
  14. Else 

VB.NET文件夾操作之復(fù)制文件

 
 
 
  1. File.Copy(filepath, 
    targetPath 
    + Path.GetFileName
    (filepath), True)  
  2. End If  
  3. Next  
  4. Return True  
  5. Catch ex As Exception  
  6. Return False  
  7. End Try  
  8. End Function 

VB.NET文件夾操作之文件夾刪除

 
 
 
  1. Function DelDir()Function DelDir
    (ByVal targetPath As String) 
    As Boolean  
  2. Try  
  3. '檢查目標(biāo)目錄是否以目錄分割字符結(jié)束,
    不是則添加  
  4. If Right(targetPath, 1) <> "
    " Then targetPath += ""  
  5. '得到源目錄的文件列表,該里面是包
    含文件以及目錄路徑的一個(gè)數(shù)組  
  6. Dim fileList As String() = 
    Directory.GetFileSystemEntries
    (targetPath)  
  7. '遍歷所有的文件和目錄  
  8. For Each filepath As String 
    In fileList  
  9. '目錄處理,遞歸  
  10. If (Directory.Exists(filepath)) Then  
  11. DelDir(targetPath + Path.GetFile
    Name(filepath))  
  12. Else  
  13. '刪除文件  
  14. File.Delete(targetPath + Path.
    GetFileName(filepath))  
  15. End If  
  16. Next  
  17. '刪除文件夾  
  18. System.IO.Directory.Delete
    (targetPath, True)  
  19. Return True  
  20. Catch ex As Exception  
  21. Return False  
  22. End Try  
  23. End Function 

VB.NET文件夾操作的相關(guān)應(yīng)用方法就為大家介紹到這里。


網(wǎng)頁題目:VB.NET文件夾操作相關(guān)技巧分享
轉(zhuǎn)載來于:http://www.5511xx.com/article/coiesoo.html