亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? zipreader.vb

?? ZIP things into smaller pakage
?? VB
字號:
 '-----------------------------------------------------------------------
'  This file is part of the Microsoft .NET SDK Code Samples.
' 
'  Copyright (C) Microsoft Corporation.  All rights reserved.
' 
'This source code is intended only as a supplement to Microsoft
'Development Tools and/or on-line documentation.  See these other
'materials for detailed information regarding Microsoft code samples.
' 
'THIS CODE AND INFORMATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY
'KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
'IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
'PARTICULAR PURPOSE.
'-----------------------------------------------------------------------
Imports System
Imports System.Collections.Generic
Imports System.IO
Imports System.IO.Compression


'/ <summary>
'/ This is a Reader that reads the files baseStream to get an 
'/ entry in the zip archive one after another.The zip entry contains 
'/ information about the file name, size, compressed size, CRC, etc.
'/ It includes support for GZIP and DEFLATE methods of compression.
'/ <summary>

Public Class ZipReader
    Private zipStream As Stream 'The zip stream which is instantiated
    'and closed after every operation
    Private zipName As String 'Name given to the archive
    Private baseStream As Stream 'The base stream from which the header 
    'and compressed data are read
    Private numberOfFiles As Int16
    Private thisMethod As Byte
    
    Private md5 As System.Security.Cryptography.MD5CryptoServiceProvider
    
    'Required for checking CRC
    '/ <summary>
    '/ Creates a new Zip input stream, reading a zip archive.
    '/ </summary>
    Public Sub New(ByVal fileStream As Stream, ByVal name As String) 
        zipName = name
        baseStream = fileStream
        numberOfFiles = - 1
        thisMethod = 255
        md5 = New System.Security.Cryptography.MD5CryptoServiceProvider()
    
    End Sub 'New
    
    
    '/ <summary>
    '/ Reads the super header
    '/ Super header structure:
    '/		number of files - 2 byte
    '/		method of compression - 1 byte
    '/ </summary>
    '/ <exception cref="ArgumentOutOfRangeException">
    '/ Thrown if the super header is tampered
    '/ </exception>
    '/ 
    Private Sub ReadSuperHeader() 
        numberOfFiles = ReadLeInt16()
        thisMethod = ReadLeByte()
        If method <> ZipConstants.DEFLATE AndAlso method <> ZipConstants.GZIP Then
            Throw New ArgumentOutOfRangeException()
        End If
    
    End Sub 'ReadSuperHeader
     
    Private Function ReadBuf(ByVal outBuf() As Byte, ByVal length As Integer) As Integer 
        Return baseStream.Read(outBuf, 0, length)
    
    End Function 'ReadBuf
    
    
    '/ <summary>
    '/ Read a byte from baseStream.
    '/ </summary>
    Private Function ReadLeByte() As Byte 
        Return System.Convert.ToByte(baseStream.ReadByte() And &HFF)
    
    End Function 'ReadLeByte
    
    
    '/ <summary>
    '/ Read an unsigned short baseStream little endian byte order.
    '/ </summary>
    Private Function ReadLeInt16() As Int16
        Dim i As Int16 = CType(ReadLeByte(), Int16)
        Dim j As Int16 = CType(ReadLeByte(), Int16)
        Return (i Or (j << 8))

    End Function 'ReadLeInt16
    
    
    '/ <summary>
    '/ Read an int baseStream little endian byte order.
    '/ </summary>
    Private Function ReadLeInt32() As Int32
        Dim ui As Int32
        Dim uj As Int32
        ui = CType(ReadLeInt16(), Int32)
        uj = CType(ReadLeInt16(), Int32)
        If (ui < 0) Then
            ui = System.Math.Pow(2, 16) + ui
        End If
        Return (ui Or (uj << 16))
    End Function 'ReadLeInt32
    
    
    Private Function ConvertToString(ByVal data() As Byte) As String 
        Return System.Text.Encoding.ASCII.GetString(data, 0, data.Length)
    
    End Function 'ConvertToString
    
    
    '/ <summary>
    '/ Open the next entry from the zip archive, and return its 
    '/ description. The method expects the pointer to be intact.
    '/ </summary>
    Private Function GetNextEntry() As ZipEntry 
        Dim currentEntry As ZipEntry = Nothing
        Try
            Dim size As Int32 = ReadLeInt32()
            If size = - 1 Then
                Return New ZipEntry(String.Empty)
            End If 
            Dim csize As Int32 = ReadLeInt32()
            Dim crc(15) As Byte
            ReadBuf(crc, crc.Length)
            
            Dim dostime As Int32 = ReadLeInt32()
            Dim nameLength As Int16 = ReadLeInt16()
            
            Dim buffer(nameLength - 1) As Byte
            ReadBuf(buffer, nameLength)
            Dim name As String = ConvertToString(buffer)
            
            currentEntry = New ZipEntry(name)
            currentEntry.Size = size
            currentEntry.CompressedSize = csize
            currentEntry.SetCrc(crc)
            currentEntry.DosTime = dostime
        Catch ex As ArgumentException
            ZipConstants.ShowError(ZipConstants.ArgumentError)
        Catch ex As ObjectDisposedException
            ZipConstants.ShowError(ZipConstants.CloseError)
        End Try
        Return currentEntry
    
    End Function 'GetNextEntry
    
    
    '/ <summary>
    '/ Writes the uncompressed data into the filename in the 
    '/ entry. It instantiates a memory stream which will serve 
    '/ as a temp store and decompresses it using Gzip Stream or
    '/ Deflate stream
    '/ </summary>
    Private Sub WriteUncompressedFile(ByVal entry As ZipEntry, ByVal completePath As String) 
        Dim ms As New MemoryStream()
        Try
            Dim b(entry.CompressedSize - 1) As Byte
            baseStream.Read(b, 0, CType(entry.CompressedSize, Integer))
            If CheckCRC(entry.GetCrc(), b) Then
                ms.Write(b, 0, b.Length)
            End If
            ms.Seek(0, SeekOrigin.Begin)
            If Method = ZipConstants.DEFLATE Then
                zipStream = New DeflateStream(ms, CompressionMode.Decompress, False)
            ElseIf Method = ZipConstants.GZIP Then
                zipStream = New GZipStream(ms, CompressionMode.Decompress, False)
            End If

            Dim index As Integer = entry.Name.LastIndexOf(ZipConstants.BackSlash)
            Dim name As String = completePath + entry.Name.Substring(index + 1)
            Dim rewrite As New FileStream(name, FileMode.Create)
            b = New Byte(entry.Size - 1) {}
            zipStream.Read(b, 0, CType(entry.Size, Integer))

            rewrite.Write(b, 0, CType(entry.Size, Integer))
            rewrite.Close()
        Catch ex As IOException
            ZipConstants.ShowError(ZipConstants.IOError)
        Catch ex As ArgumentException
            ZipConstants.ShowError(ZipConstants.ArgumentError)
        Finally
            zipStream.Close()
            ms.Close()
        End Try
    
    End Sub 'WriteUncompressedFile
    
    
    '/ <summary>
    '/ Extracts all the entries in the list of entries
    '/	</summary>
    '/ <param name="zipentries">
    '/	List of all the zip entries. Can be empty.
    '/ </param>
    Public Sub ExtractAll(ByVal zipEntries As List(Of ZipEntry), _
                    ByVal startPath As String)
        Try
            Dim dir As New DirectoryInfo(startPath + zipName)
            If Not dir.Exists Then
                dir.Create()
            End If
            Dim jump As Integer = 3
            baseStream.Seek(jump, SeekOrigin.Begin)

            Dim entry As ZipEntry
            For Each entry In zipEntries
                Dim index1 As Integer = entry.Name.IndexOf(ZipConstants.BackSlash)
                Dim index2 As Integer = entry.Name.LastIndexOf(ZipConstants.BackSlash)
                Dim relPath As String = entry.Name.Substring(index1 + 1, index2 - index1)
                If index1 = 0 Then
                    relPath = String.Empty
                End If
                If relPath.Length <> 0 Then
                    dir.CreateSubdirectory(relPath)
                End If
                jump = ZipConstants.FixedHeaderSize + entry.NameLength
                baseStream.Seek(jump, SeekOrigin.Current)
                WriteUncompressedFile(entry, startPath + zipName + ZipConstants.BackSlash + relPath)
            Next entry
            CompressionForm.statusMessage = String.Format(System.Threading.Thread.CurrentThread.CurrentUICulture, ZipConstants.ExtractMessage, startPath + zipName + ZipConstants.BackSlash)
        Catch ex As IOException
            ZipConstants.ShowError(ZipConstants.IOError)
        Catch ex As OutOfMemoryException
            ZipConstants.ShowError(ZipConstants.MemoryError)
        End Try
    End Sub


    '/ <summary>
    '/ Extracts the specified entry
    '/	</summary>
    '/ <param name="entry">
    '/	The entry that is to be extracted.Cannot be null
    '/ </param>
    '/ <param name="jump">
    '/	The offset from the SeekOrigin.Begin at which the 
    '/ comrpessed data is located
    '/ </param>

    Public Sub Extract(ByVal entry As ZipEntry, ByVal jump As Long, ByVal startPath As String)
        Try
            Dim dir As New DirectoryInfo(startPath + zipName)
            If Not dir.Exists Then
                dir.Create()
            End If
            Dim index1 As Integer = entry.Name.IndexOf(ZipConstants.BackSlash)
            Dim index2 As Integer = entry.Name.LastIndexOf(ZipConstants.BackSlash)
            Dim relPath As String = entry.Name.Substring(index1 + 1, index2 - index1)
            If index1 = 0 Then
                relPath = String.Empty
            End If
            If relPath.Length <> 0 Then
                dir.CreateSubdirectory(relPath)
            End If
            baseStream.Seek(jump, SeekOrigin.Begin)
            jump = ZipConstants.FixedHeaderSize + entry.NameLength
            baseStream.Seek(jump, SeekOrigin.Current)

            WriteUncompressedFile(entry, startPath + zipName + ZipConstants.BackSlash + relPath)
            CompressionForm.statusMessage = String.Format(System.Threading.Thread.CurrentThread.CurrentUICulture, ZipConstants.ExtractMessage, startPath + zipName + ZipConstants.BackSlash)
        Catch ex As IOException
            ZipConstants.ShowError(ZipConstants.IOError)
        Catch ex As OutOfMemoryException
            ZipConstants.ShowError(ZipConstants.MemoryError)
        End Try
    End Sub

    '/ <summary>
    '/ Gets all the entries in the file 
    '/ </summary>
    '/ <returns>
    '/	List of all the zip entries
    '/ </returns> 

    Public Function GetAllEntries() As List(Of ZipEntry)
        Dim headers As List(Of ZipEntry)
        headers = Nothing
        Try
            If thisMethod = 255 OrElse numberOfFiles = -1 Then
                baseStream.Seek(0, SeekOrigin.Begin)
                ReadSuperHeader()
            End If
            headers = New List(Of ZipEntry)(numberOfFiles)
            baseStream.Seek(3, SeekOrigin.Begin)
            Dim i As Integer

            While i < numberOfFiles
                Dim entry As ZipEntry = GetNextEntry()
                headers.Add(entry)
                baseStream.Seek(entry.CompressedSize, SeekOrigin.Current)
                i += 1
            End While
        Catch ex As IOException
            ZipConstants.ShowError(ZipConstants.IOError)
        End Try

        Return headers
    End Function


    '/ <summary>
    '/ Gets the method of compression of the archive.
    '/ </summary>
    '/ <returns>
    '/ the ZipConstants.Deflate or ZipConstants.Gzip
    '/ </returns>
    Public ReadOnly Property Method() As Byte
        Get
            Return thisMethod
        End Get
    End Property

    'Check the CRC of the byte array and return true if check successful
    'false otherwise
    Private Function CheckCRC(ByVal crc As Byte(), ByVal data As Byte()) As Boolean
        Dim newCrc As Byte() = md5.ComputeHash(data)
        Dim i As Integer

        While i < crc.Length
            If crc(i) <> newCrc(i) Then
                Return False
            End If
            i += 1
        End While
        Return True

    End Function 'CheckCRC
End Class 'ZipReader

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美电影免费观看高清完整版在线观看 | 国产乱对白刺激视频不卡 | 欧美综合亚洲图片综合区| 国产一区二区三区高清播放| 日本欧美加勒比视频| 亚洲电影一级片| 婷婷六月综合亚洲| 五月天一区二区| 日韩激情视频在线观看| 日韩精品乱码av一区二区| 一区二区三区日韩欧美| 亚洲综合清纯丝袜自拍| 尤物视频一区二区| 玉足女爽爽91| 婷婷久久综合九色国产成人| 视频一区视频二区中文字幕| 日韩制服丝袜先锋影音| 久久成人免费电影| 国产乱人伦偷精品视频免下载| 国产精品一二三四| 91蜜桃网址入口| 欧美日韩免费观看一区二区三区| 欧美日韩国产乱码电影| 欧美大片在线观看一区二区| 久久综合给合久久狠狠狠97色69| 欧美高清在线一区| 中文字幕亚洲欧美在线不卡| 一区二区三区在线免费播放| 日本不卡中文字幕| 国产激情一区二区三区四区 | 日本一区二区三区高清不卡| 国产欧美精品区一区二区三区| 亚洲欧美一区二区久久| 亚洲成av人在线观看| 国产一区二区三区av电影| av欧美精品.com| 欧美精品日韩一本| 国产人成亚洲第一网站在线播放 | 91影视在线播放| 欧美男人的天堂一二区| 久久精品视频一区二区| 亚洲一二三区在线观看| 国产一区二区三区在线看麻豆| aa级大片欧美| 欧美大片拔萝卜| 亚洲影院在线观看| 成人夜色视频网站在线观看| 欧美日韩精品是欧美日韩精品| 国产色91在线| 玖玖九九国产精品| 欧美午夜电影一区| 国产精品久线在线观看| 久久精品国产一区二区三| 色婷婷久久久久swag精品| 国产亚洲一区字幕| 另类调教123区| 欧美精品日韩综合在线| 亚洲综合精品自拍| 不卡av免费在线观看| 久久蜜桃av一区二区天堂| 日本vs亚洲vs韩国一区三区二区| 成人av在线网站| 国产日韩欧美一区二区三区乱码| 亚洲成av人在线观看| 色999日韩国产欧美一区二区| 国产拍揄自揄精品视频麻豆| 日韩av一二三| 9191精品国产综合久久久久久| 18欧美亚洲精品| 国产乱子轮精品视频| 日韩精品一区二区三区在线观看| 亚洲第四色夜色| 欧美在线一区二区三区| 亚洲精品视频免费看| 91在线观看美女| 亚洲乱码国产乱码精品精的特点| 成人影视亚洲图片在线| 中文一区一区三区高中清不卡| 激情文学综合网| 久久婷婷成人综合色| 国产激情一区二区三区桃花岛亚洲| 日韩女优av电影| 精彩视频一区二区| 久久亚洲精华国产精华液| 精品一区二区三区欧美| 欧美精品一区二区三区蜜臀 | 国产一区二区精品在线观看| 日韩一级在线观看| 国产激情91久久精品导航 | 在线一区二区观看| 一二三四社区欧美黄| 欧美巨大另类极品videosbest| 亚洲1区2区3区4区| 日韩免费电影一区| 国产成人精品免费网站| 亚洲欧美一区二区在线观看| 99久久久久久| 天堂久久一区二区三区| 精品免费国产二区三区| 国产成人久久精品77777最新版本| 国产欧美日韩中文久久| 91丨九色丨国产丨porny| 亚洲国产精品一区二区www| 宅男噜噜噜66一区二区66| 国产一区二区在线看| 亚洲婷婷在线视频| 在线综合视频播放| 国产成人亚洲精品青草天美| 亚洲欧美日韩成人高清在线一区| 欧美日韩国产一二三| 美女网站色91| 亚洲欧美色图小说| 9191成人精品久久| www.性欧美| 奇米综合一区二区三区精品视频| 久久精品在线免费观看| 91色porny| 国产麻豆一精品一av一免费| 亚洲激情第一区| 久久影视一区二区| 欧美精品在欧美一区二区少妇| 国产一本一道久久香蕉| 午夜精品视频一区| 国产女人18水真多18精品一级做| 色8久久人人97超碰香蕉987| 精品一区二区av| 一区二区高清免费观看影视大全| 久久先锋资源网| 日韩视频免费直播| 一本久久精品一区二区| 久久成人免费日本黄色| 亚洲成人三级小说| 亚洲少妇中出一区| 亚洲精品一区二区三区福利| 8v天堂国产在线一区二区| 94-欧美-setu| 成人18视频在线播放| 久久精品国产99| 视频在线观看国产精品| 亚洲综合在线第一页| 亚洲婷婷综合色高清在线| 欧美经典一区二区三区| 久久亚洲精品小早川怜子| 日韩一区二区免费在线电影| 在线免费观看成人短视频| av电影天堂一区二区在线 | 日韩一区在线免费观看| 国产视频一区二区三区在线观看| 欧美成人a在线| 欧美tk—视频vk| 欧美大肚乱孕交hd孕妇| 精品少妇一区二区| 日韩一区二区免费视频| 日韩网站在线看片你懂的| 3d成人动漫网站| 日韩精品一区二区三区四区视频| 欧美精品亚洲二区| 日韩欧美国产综合一区| 日韩欧美成人一区| 久久综合久久综合九色| 久久婷婷国产综合国色天香| 欧美精品一区二区在线播放| 久久精品人人做人人综合 | 国产精品一区专区| 国产suv精品一区二区三区| 国产成人av影院| 99这里只有精品| 在线观看日韩电影| 欧美三电影在线| 日韩视频国产视频| 久久久久高清精品| 亚洲视频在线一区观看| 亚洲图片欧美视频| 蜜臀精品久久久久久蜜臀 | 亚洲黄色录像片| 亚洲www啪成人一区二区麻豆| 婷婷夜色潮精品综合在线| 美国三级日本三级久久99| 韩国一区二区视频| 成人理论电影网| 欧美午夜电影一区| 精品国产91乱码一区二区三区 | 久久影院电视剧免费观看| 亚洲国产精品国自产拍av| 亚洲理论在线观看| 蜜桃传媒麻豆第一区在线观看| 国产福利一区二区三区视频| 色综合夜色一区| 日韩美女视频在线| 亚洲女女做受ⅹxx高潮| 免费高清在线视频一区·| av网站免费线看精品| 欧美一级理论性理论a| 中文字幕制服丝袜一区二区三区 | 欧美精品国产精品| 久久精品亚洲精品国产欧美| 亚洲国产精品综合小说图片区| 黄色小说综合网站| 欧美日韩中文国产| 国产精品视频线看|