1、你先搞懂 winrar.exe 的解壓參數(shù)格式,然后把winrar.exe和相關(guān)文件加入到資源文件中,然后調(diào)用 資源文件中的winrar.exe
在蘭溪等地區(qū),都構(gòu)建了全面的區(qū)域性戰(zhàn)略布局,加強(qiáng)發(fā)展的系統(tǒng)性、市場前瞻性、產(chǎn)品創(chuàng)新能力,以專注、極致的服務(wù)理念,為客戶提供網(wǎng)站建設(shè)、做網(wǎng)站 網(wǎng)站設(shè)計制作按需定制設(shè)計,公司網(wǎng)站建設(shè),企業(yè)網(wǎng)站建設(shè),成都品牌網(wǎng)站建設(shè),全網(wǎng)整合營銷推廣,外貿(mào)營銷網(wǎng)站建設(shè),蘭溪網(wǎng)站建設(shè)費(fèi)用合理。
2、弄明白rar/zip文件解壓/壓縮方法和格式,自己寫程序 (可能會比較麻煩)
直接讀取 一個gz壓縮文件:
我直接創(chuàng)建了一個內(nèi)容:"asdfasdfasfd" 的 1.txt文件并用gzip 壓縮。
讀?。?/p>
$ zcat 1.txt.gz
asdfasdfasfd
如果內(nèi)容過長可以接 less 查看:
$ zcat 1.txt.gz | less
如果機(jī)器安裝有winRar軟件,就可以通過shell來借用他的功能達(dá)到壓縮文件的效果;
參考代碼如下:
Dim DeliveryF As String = Server.MapPath("..\Temp\DeliveryFactors.xls") '原始文件 (壓縮前)
Dim TruckInfo As String = Server.MapPath("..\Temp\TruckInformation.xls")
Dim QDetail As String = Server.MapPath("..\Temp\QuotationDetail.xls")
'用shell命令調(diào)用winrar.exe創(chuàng)建壓縮文件()
Dim winRarexe As String = "C:\Program Files\WinRAR\Rar" 'winzip 執(zhí)行文件的位置
Dim wtarget As String = "C:\temp\QuotationVAComparsion.zip" '目地文件 (壓縮后)
Dim command As String = winRarexe " a " wtarget " " DeliveryF " " TruckInfo " " QDetail
'這個命令你可以查看winrar的命令集
Dim retval As Double 'Shell 指令傳回值
retval = Shell(command, AppWinStyle.MinimizedFocus)
手機(jī)敲很累的!一定要給分?。「袷绞牵簍ar 選項 文件.選項有 -c:產(chǎn)生打包文件 -v:顯示詳細(xì)信息 -f:指定壓縮后的文件名 -z:打包同時壓縮!舉個例子吧!將目錄my打包并壓縮成my.tar.gz就這樣tar -zcvf my.tar.gz my
這個是我之前寫的。在需要時調(diào)用即可。
Public Shared Function Encrypt(ByVal Text As String, ByVal sKey As String) As String
Dim provider As New DESCryptoServiceProvider()
Dim bytes As Byte() = Encoding.[Default].GetBytes(Text)
provider.Key = Encoding.ASCII.GetBytes(FormsAuthentication.HashPasswordForStoringInConfigFile(sKey, "md5").Substring(0, 8))
provider.IV = Encoding.ASCII.GetBytes(FormsAuthentication.HashPasswordForStoringInConfigFile(sKey, "md5").Substring(0, 8))
Dim stream As New MemoryStream()
Dim stream2 As New CryptoStream(stream, provider.CreateEncryptor(), CryptoStreamMode.Write)
stream2.Write(bytes, 0, bytes.Length)
stream2.FlushFinalBlock()
Dim builder As New StringBuilder()
For Each num As Byte In stream.ToArray()
builder.AppendFormat("{0:X2}", num)
Next
Return builder.ToString()
End Function
希望能幫到你
Private Function myEncrypt(ByVal Code As String) As String
Dim Result As String = ""
Dim CurrentChar As Char
For i As Integer = 0 To Code.Length - 1
CurrentChar = Code.Substring(i, 1)
Select Case Code.Substring(i, 1)
Case "Z"
Result = "a"
Case "z"
Result = "A"
Case Else
Result = Chr(Asc(CurrentChar) + 1)
End Select
Next
Return Result
End Function
'vb.net 2005 調(diào)試通過