成人免费xxxxx在线视频软件_久久精品久久久_亚洲国产精品久久久_天天色天天色_亚洲人成一区_欧美一级欧美三级在线观看

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

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

在我們運用VB.NET這門語言時,我們嘗嘗會遇到VB.NET壓縮和解壓縮的問題,如何能更好的實現VB.NET壓縮的問題,在這里我們用一個實例給大家詳細分析一下,希望可以給大家帶來幫助。

VB.NET壓縮和解壓縮實現代碼:

  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="還原壓縮數據*.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 

你的應用程序的bin下要有一個winrar的可執行文件.

【編輯推薦】

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

2018-09-14 16:18:26

Linux壓縮文件應用程序

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數組

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字符串數組

2009-10-28 17:44:31

VB.NET語言

2010-01-12 10:40:58

VB.NET數據庫壓縮

2009-10-21 09:19:40

VB.NET文件壓縮 

2023-12-21 07:30:36

PythonZipfileTarfile
點贊
收藏

51CTO技術棧公眾號

主站蜘蛛池模板: 国产91精品久久久久久久网曝门 | 午夜在线精品 | 不卡一区二区三区四区 | 曰韩一二三区 | 在线视频成人 | 亚洲精品日韩在线 | 人人九九精 | 国产成人免费视频网站高清观看视频 | 日日摸日日碰夜夜爽亚洲精品蜜乳 | 国产成人在线一区 | 亚洲一区免费 | 伊人免费在线观看高清 | 日韩在线视频一区 | 欧美精品在线播放 | 91成人| 国内成人免费视频 | 亚洲成av人片在线观看无码 | 日韩高清一区 | 二区在线视频 | 美女久久久久久久久 | 国产日韩欧美激情 | 日韩精品在线观看视频 | 国产精品欧美一区二区 | 久久不射网 | 亚洲情侣视频 | 欧美日韩在线国产 | 国产一区二区在线播放视频 | 日日干夜夜操 | 国产精品一区二区三区在线 | 黄色毛片在线看 | 国产色在线 | 免费一级片| 999久久久 | 国产成人精品一区二区三区在线 | 国产电影一区二区三区爱妃记 | 国产一二区免费视频 | 久久久久久久久蜜桃 | 欧美成人精品欧美一级 | 波多野结衣一二三区 | www.99精品| 免费亚洲网站 |