ItsMods

Full Version: Unzipping program
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
C++ Code
  1. Imports System.IO
  2. Public Class Form1
  3.  
  4. Private Sub KryptonButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles KryptonButton1.Click
  5. Using ofd As New OpenFileDialog
  6. ofd.Filter = "ZipFile|*.zip"
  7. If ofd.ShowDialog = Windows.Forms.DialogResult.OK Then
  8. Dim file As String = ofd.FileName
  9. Dim cu As New ClassUnzip(file, Path.Combine(Path.GetDirectoryName(file), "test_unzip_folder"))
  10. AddHandler cu.UnzipFinishd, AddressOf Unziped
  11. cu.UnzipNow()
  12. End If
  13. End Using
  14.  
  15. End Sub
  16.  
  17. Private Sub Unziped()
  18. MessageBox.Show("Unzipping finished")
  19. End Sub
  20.  
  21. End Class
  22.  
  23.  
  24. Classe:
  25.  
  26.  
  27. Imports System
  28. Imports System.IO
  29.  
  30. Public Class ClassUnzip
  31.  
  32. Private _file As String
  33. Private _folder As String
  34. Private _towhere As String
  35.  
  36. Private _shell As Shell32.IShellDispatch2
  37.  
  38. ''' <summary></summary>
  39. ''' <remarks></remarks>
  40. Public Event Unzipstart()
  41. ''' <summary></summary>
  42. ''' <remarks></remarks>
  43. Public Event UnzipFinishd()
  44.  
  45. ''' <summary></summary>
  46. ''' <param name="file"></param>
  47. ''' <param name="towhere"></param>
  48. ''' <remarks></remarks>
  49. Public Sub New(ByVal file As String, ByVal towhere As String)
  50. _file = file
  51. _towhere = towhere
  52. _folder = Path.Combine(Path.GetDirectoryName(_file), _towhere)
  53. _shell = CreateObject("Shell.Application")
  54. End Sub
  55.  
  56. ''' <summary></summary>
  57. ''' <returns></returns>
  58. ''' <remarks></remarks>
  59. Public Function UnzipNow() As Boolean
  60.  
  61. If Directory.Exists(_folder) = False Then
  62. Directory.CreateDirectory(_folder)
  63. End If
  64.  
  65. RaiseEvent Unzipstart()
  66.  
  67. Dim temp As Shell32.Folder = _shell.NameSpace((_folder))
  68. If temp IsNot Nothing Then
  69. temp.CopyHere(_shell.NameSpace((_file)).Items)
  70. End If
  71.  
  72. RaiseEvent UnzipFinishd()
  73.  
  74. Return True
  75. End Function
  76.  
  77. ''' <summary></summary>
  78. ''' <value></value>
  79. ''' <returns></returns>
  80. ''' <remarks></remarks>
  81. Public Property UnZipFile() As String
  82. Get
  83. Return _file
  84. End Get
  85. Set(ByVal value As String)
  86. _file = value
  87. End Set
  88. End Property
  89.  
  90. ''' <summary></summary>
  91. ''' <value></value>
  92. ''' <returns></returns>
  93. ''' <remarks></remarks>
  94. Public Property UnzipTo() As String
  95. Get
  96. Return _towhere
  97. End Get
  98. Set(ByVal value As String)
  99. _towhere = value
  100. End Set
  101. End Property
  102.  
  103. End Class
I didn't know you were smart enough to make something like this.

Good job.
LOLWUT?!!!!!!!!!!!!!!!?!?!?!?!
U SAID IT?!?! MY MAIN HATER SAID "GJ" TO ME?!?!?!?!
I WILL GO FUCK MYSELF Confusedhocked:
VB suck though





better?
hmm... the phrase u said doesnt look friendly but it took away the feeling of deception)
i work with VB liiiiiiiitle bit. i <3 mapping. SDK & UDK. but it needs no tutorials in text. only in videos =3
wat?

(08-15-2011, 17:23)G-Man Wrote: [ -> ]

Fuck yea! nobody figured out my way yet.
Pages: 1 2