FastZip クラス in #ziplib


  #ziplib

↓ダウンロードはこちら
http://www.icsharpcode.net/OpenSource/SharpZipLib/Default.aspx

少し解る人なら余裕で ZIP ファイルの処理が可能です。
サンプルソースと chm ドキュメントをいっしょにダウンロードして実装してみましょう

  LboxGrid を使った一覧処理




http://lightbox.on.coocan.jp/r205/2008/FAST_ZIP.lzh



  

Imports ICSharpCode.SharpZipLib.Zip

Public Class Form1

	' ************************************************************
	' 初期処理
	' ************************************************************
	Sub New()

		' この呼び出しは、Windows フォーム デザイナで必要です。
		InitializeComponent()

		' InitializeComponent() 呼び出しの後で初期化を追加します。
		Me.StartPosition = FormStartPosition.Manual
		Me.Left = 0
		Me.Top = 0
		Me.Width = 900
		Me.Height = 600

		Me.LboxGrid1.UseParentFitForm = Me
		Me.LboxGrid1.AllowDrop = True
		Me.LboxGrid1.RowHeadersWidth = 50

		Me.LboxGrid1.AddColumn("NAME", "名称")
		Me.LboxGrid1.AddColumn("SIZE", "サイズ")
		Me.LboxGrid1.AddColumn("SIZE2", "圧縮サイズ")
		Me.LboxGrid1.AddColumn("DATE", "日付")
		Me.LboxGrid1.AddColumn("PATH", "パス")

	End Sub

	' ************************************************************
	' ドラッグ・ドロップ対象拡張子
	' ************************************************************
	Private Sub LboxGrid1_DragEnter(ByVal sender As System.Object, _
	ByVal e As System.Windows.Forms.DragEventArgs) Handles LboxGrid1.DragEnter

		' ファイルのパスを(複数)取得
		Dim target As String() = CType(e.Data.GetData(DataFormats.FileDrop, False), String())

		' 拡張子を分解
		Dim ext As String = System.IO.Path.GetExtension(target(0))
		ext = ext.ToUpper()

		' 拡張子が ZIP で無ければ許可しない
		If ext = ".ZIP" Then
			e.Effect = DragDropEffects.Move
		Else
			e.Effect = DragDropEffects.None
		End If


	End Sub

	' ************************************************************
	' ドラッグ・ドロップ
	' ************************************************************
	Private Sub LboxGrid1_DragDrop(ByVal sender As System.Object, _
	ByVal e As System.Windows.Forms.DragEventArgs) Handles LboxGrid1.DragDrop

		' ファイルのパスを(複数)取得
		Dim target As String() = CType(e.Data.GetData(DataFormats.FileDrop, False), String())
		' 複数選択されていても、先頭のファイル

		ListZipFile(target(0))

	End Sub

	' ************************************************************
	' 一覧
	' ************************************************************
	Private Sub ListZipFile(ByVal Path As String)

		Me.Text = Path

		Dim zipFile As New ZipFile(Path)

		Me.Cursor = Cursors.WaitCursor
		Me.Enabled = False

		Me.LboxGrid1.Clear()

		Dim max As Integer = 100
		Dim cnt As Integer = 0

		For i As Integer = 0 To zipFile.Count - 1
			Dim target As ZipEntry = zipFile(i)
			If target.IsFile Then
				cnt += 1
				If cnt > max Then
					Exit For
				End If

				Me.LboxGrid1.AddRow()
				Me.LboxGrid1.SetRowHeaderText(cnt.ToString().Trim())
				Me.LboxGrid1.SetColumnText("NAME", System.IO.Path.GetFileName(target.Name))
				Me.LboxGrid1.SetColumnText("SIZE", target.Size.ToString())
				Me.LboxGrid1.SetColumnText("SIZE2", target.CompressedSize.ToString())
				Me.LboxGrid1.SetColumnText("DATE", target.DateTime.ToString())
				Me.LboxGrid1.SetColumnText("PATH", target.Name)

			End If
		Next

		zipFile.Close()

		Me.Enabled = True
		Me.Cursor = Cursors.Default

	End Sub

End Class
  




yahoo  google  MSDN  MSDN(us)  WinFAQ  Win Howto  tohoho  ie_DHTML  vector  wdic  辞書  天気 


[dnettool]
Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
24/04/20 11:40:44
InfoBoard Version 1.00 : Language=Perl

1 BatchHelper COMprog CommonSpec Cprog CprogBase CprogSAMPLE CprogSTD CprogSTD2 CprogWinsock Cygwin GameScript HTML HTMLcss InstallShield InstallShieldFunc JScript JScriptSAMPLE Jsfuncs LLINK OldProg OracleGold OracleSilver PRO PRObrowser PROc PROconePOINT PROcontrol PROftpclient PROjscript PROmailer PROperl PROperlCHAT PROphp PROphpLesson PROphpLesson2 PROphpLesson3 PROphpfunction PROphpfunctionArray PROphpfunctionMisc PROphpfunctionString PROsql PROvb PROvbFunction PROvbString PROvbdbmtn PROvbonepoint PROwebapp PROwin1POINT PROwinSYSTEM PROwinYOROZU PROwindows ProjectBoard RealPHP ScriptAPP ScriptMaster VBRealtime Vsfuncs a1root access accreq adsi ajax amazon argus asp aspSample aspVarious aspdotnet aw2kinst cappvariety centura ckeyword classStyle cmaterial cmbin cmdbapp cmenum cmlang cmlistbox cmstd cmstdseed cmtxt cs daz3d db dbCommon dbaccess dnettool dos download flex2 flex3 flex4 framemtn framereq freeWorld freesoft gimp ginpro giodownload google hdml home hta htmlDom ie9svg install java javaSwing javascript jetsql jquery jsp jspTest jspVarious lightbox listasp listmsapi listmsie listmsiis listmsnt listmspatch listmsscript listmsvb listmsvc memo ms msde mysql netbeans oraPlsql oracle oracleWiper oraclehelper orafunc other panoramio pear perl personal pgdojo pgdojo_cal pgdojo_holiday pgdojo_idx pgdojo_ref pgdojo_req php phpVarious phpguide plsql postgres ps r205 realC realwebapp regex rgaki ruby rule sboard sc scprint scquest sdb sdbquest seesaa setup sh_Imagick sh_canvas sh_dotnet sh_google sh_tool sh_web shadowbox shgm shjquery shvbs shweb sjscript skadai skywalker smalltech sperl sqlq src systemdoc tcpip tegaki three toolbox twitter typeface usb useXML vb vbdb vbsfunc vbsguide vbsrc vpc wcsignup webanymind webappgen webclass webparts webtool webwsh win8 winofsql wmi work wp youtube