日韩无码专区无码一级三级片|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壓縮和解壓縮實(shí)例全面分析

在我們運(yùn)用VB.NET這門語言時(shí),我們嘗嘗會(huì)遇到VB.NET壓縮和解壓縮的問題,如何能更好的實(shí)現(xiàn)VB.NET壓縮的問題,在這里我們用一個(gè)實(shí)例給大家詳細(xì)分析一下,希望可以給大家?guī)韼椭?/p>

為蓮花等地區(qū)用戶提供了全套網(wǎng)頁設(shè)計(jì)制作服務(wù),及蓮花網(wǎng)站建設(shè)行業(yè)解決方案。主營業(yè)務(wù)為網(wǎng)站設(shè)計(jì)制作、網(wǎng)站設(shè)計(jì)、蓮花網(wǎng)站設(shè)計(jì),以傳統(tǒng)方式定制建設(shè)網(wǎng)站,并提供域名空間備案等一條龍服務(wù),秉承以專業(yè)、用心的態(tài)度為用戶提供真誠的服務(wù)。我們深信只要達(dá)到每一位用戶的要求,就會(huì)得到認(rèn)可,從而選擇與我們長(zhǎng)期合作。這樣,我們也可以走得更遠(yuǎn)!

VB.NET壓縮和解壓縮實(shí)現(xiàn)代碼:

 
 
 
  1. PublicEnumZip  
  2. Zip=0'壓縮  
  3. UnZip=1'解壓縮  
  4. EndEnum  
  5. '壓縮、解壓縮  
  6. PublicFunctionZipFile(ByValinDirPathAsString,OptionalByVal_zipAsZip=Zip.Zip,_  
  7. OptionalByValstrFileNameAsString="C:\BACKUP")AsBoolean  
  8. DimInfoAsNewInformation  
  9. DimPrintMessageAsNewErrorinf  
  10. DimstrCommandAsString  
  11. If_zip=Zip.ZipThen  
  12. DimdirectoryEntriesAsString()  
  13. directoryEntries=System.IO.Directory.GetFileSystemEntries(inDirPath)  
  14. DimstrFileAsString,strFileAllAsString  
  15. ForEachstrFileIndirectoryEntries  
  16. strFileAllstrFileAll=strFileAll&"-ep1"&strFile  
  17. Next  
  18. DimstrPassAsString=InputBox(Info.NOR_InputPassword,Info.NOR_PasswordInput)  
  19. IfstrPass.Length>0Then  
  20. strCommand="winrarA-hp"+strPass+"-ep1"  
  21. Else  
  22. strCommand="winrarA-ep1" 
  23. EndIf  
  24. strCommandstrCommand=strCommand&Space(1)&strFileName&Space(1)&strFileAll  
  25. Try  
  26. IfSystem.IO.File.Exists(strFileName)Then  
  27. IfMsgBox(Info.NOR_ReplaceFile,_  
  28. MsgBoxStyle.OKCancel+_  
  29. MsgBoxStyle.Information,Info.NOR_Prompt)=MsgBoxResult.CancelThen  
  30. ReturnFalse  
  31. Else  
  32. Shell(strCommand,AppWinStyle.NormalFocus,True)  
  33. EndIf  
  34. Else  
  35. Shell(strCommand,AppWinStyle.NormalFocus,True)  
  36. EndIf  
  37. MsgBox(Info.SUC_ZipBackSuccess,MsgBoxStyle.OKOnly+MsgBoxStyle.Information,Info.NOR_Prompt)  
  38. ReturnTrue  
  39. Catch  
  40. PrintMessage.WriteErr("Cls_Common->ZipFile",Info.ERR_ZipBackError)  
  41. MsgBox(Info.ERR_ZipBackError,MsgBoxStyle.OKOnly+MsgBoxStyle.Information,Info.NOR_Prompt)  
  42. ReturnFalse  
  43. EndTry  
  44. Else  
  45. DimOpenDialogAsNewOpenFileDialog  
  46. OpenDialog.Filter="還原壓縮數(shù)據(jù)*.rar|*.rar" 
  47. IfOpenDialog.ShowDialog=DialogResult.CancelThen  
  48. OpenDialog.Dispose()  
  49. ReturnFalse  
  50. EndIf  
  51. strFileName=OpenDialog.FileName  
  52. DimstrRePassAsString=InputBox(Info.NOR_InputPassword,Info.NOR_PasswordInput)  
  53. IfstrRePass.Trim.Length>0Then  
  54. strCommand="winrarX-hp"+strRePass.Trim+"-o+-inul-ep2"  
  55. Else  
  56. strCommand="winrarX-o+-inul-ep2" 
  57. EndIf  
  58. strCommandstrCommand=strCommand&Space(1)&strFileName&Space(1)&Application.StartupPath  
  59. OpenDialog.Dispose()  
  60. Try  
  61. Shell(strCommand,AppWinStyle.NormalFocus,True)  
  62. MsgBox(Info.SUC_ZipRevertSuccess,MsgBoxStyle.OKOnly+MsgBoxStyle.Information,Info.NOR_Prompt)  
  63. ReturnTrue  
  64. Catch  
  65. PrintMessage.WriteErr("Cls_Common->ZipFile",Info.ERR_ZipRevertError)  
  66. MsgBox(Info.ERR_ZipRevertError,MsgBoxStyle.OKOnly+MsgBoxStyle.Information,Info.NOR_Prompt)  
  67. ReturnFalse  
  68. EndTry  
  69. EndIf  
  70. 'Debug.Write(strCommand)  
  71. EndFunction 

你的應(yīng)用程序的bin下要有一個(gè)winrar的可執(zhí)行文件.


文章名稱:VB.NET壓縮和解壓縮實(shí)例全面分析
文章源于:http://www.5511xx.com/article/djjjdgc.html