Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports Ionic.Zip
- Public Class Main
- Dim appPath As String = Application.StartupPath()
- Private Sub Main_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- 'SplashScreen.BarLong(100)
- 'Dim i As Integer = 0
- 'While i <= 100
- 'SplashScreen.ShowBar(i)
- 'i += 1
- 'Threading.Thread.Sleep(100)
- 'End While
- My.Computer.FileSystem.CopyFile(appPath & "\data\data.jwsdb", appPath & "\data\data.zip")
- Dim ZipToUnpack As String = appPath & "\data\data.zip"
- Dim UnpackDirectory As String = appPath & "\data\tmp\"
- Using zip1 As ZipFile = ZipFile.Read(ZipToUnpack)
- Dim es As ZipEntry
- For Each es In zip1
- es.Extract(UnpackDirectory, ExtractExistingFileAction.OverwriteSilently)
- Next
- End Using
- System.IO.File.Delete(appPath & "\data\data.zip")
- IO.File.SetAttributes(appPath & "\data\tmp", IO.FileAttributes.Hidden)
- ThumbnailGenerate1.Directorypath = appPath & "\data\tmp\"
- End Sub
- Private Sub Export_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Export.Click
- SaveFileDialog1.Filter = "JWS Files (*.jws*)|*.jws"
- If SaveFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK _
- Then
- Using writer = New IO.StreamWriter(SaveFileDialog1.FileName)
- For Each cb As CheckBox In ThumbnailGenerate1.Controls.OfType(Of CheckBox)()
- If cb.Checked Then
- writer.WriteLine(cb.Text)
- End If
- Next
- End Using
- End If
- End Sub
- Private Sub ThumbnailGenerate1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ThumbnailGenerate1.Load
- End Sub
- Private Sub Main_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
- ThumbnailGenerate1.Dispose()
- System.IO.Directory.Delete(appPath & "\data\tmp", True)
- Application.Exit()
- End Sub
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- ThumbnailGenerate1.Dispose()
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement