偷偷摘套内射激情视频,久久精品99国产国产精,中文字幕无线乱码人妻,中文在线中文a,性爽19p

VB.NET壓縮和解壓縮實例全面分析

開發(fā) 后端
文章主要介紹了VB.NET 壓縮和解壓縮的應(yīng)用實例,如何更好,更快速的對VB.NET 壓縮的運用?在這里會為你詳細講解,希望可以給你帶來答案。

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

VB.NET壓縮和解壓縮實現(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下要有一個winrar的可執(zhí)行文件.

【編輯推薦】

  1. 全方位分析VB.NET編碼規(guī)范
  2. 剖析VB.NET Process的屬性與對象
  3. VB.NET SendKeys方法與鍵入值
  4. 用實例講述VB.NET Process類
  5. 簡單講述VB.NET表間拖放
責(zé)任編輯:田樹 來源: csdn
相關(guān)推薦

2018-09-14 16:18:26

Linux壓縮文件應(yīng)用程序

2009-10-28 10:04:53

VB.NET XmlW

2021-02-22 07:58:52

Linux壓縮解壓

2012-05-10 09:43:28

2009-11-04 10:54:53

VB.NET MOVE

2009-10-29 15:16:02

VB.NET文件傳送

2009-10-14 15:20:21

VB.NET窗體指針

2009-10-15 10:57:16

VB.NET Text

2009-11-02 15:57:36

VB.NET WEB

2010-01-11 17:58:36

VB.NET壓縮ZIP

2009-10-27 09:45:03

VB.NET數(shù)組

2009-10-28 14:34:44

VB.NET Tree

2010-01-04 09:27:31

Linux壓縮解壓縮命令詳解

2009-11-10 12:27:04

VB.NET遠程控制

2024-06-20 08:09:24

2009-10-16 13:04:57

VB.NET字符串?dāng)?shù)組

2009-10-28 17:44:31

VB.NET語言

2010-01-12 10:40:58

VB.NET數(shù)據(jù)庫壓縮

2009-10-21 09:19:40

VB.NET文件壓縮 

2023-12-21 07:30:36

PythonZipfileTarfile
點贊
收藏

51CTO技術(shù)棧公眾號