Insert a string into a different program?
I have a program that runs the checked items from a ListView control. These items are self-extracting ZIP .EXE files. Unfortunately, I want them encrypted, and it doesn't seem like WinZip lets you pass the password as a parameter. This means, the user has to input the password (they're all the same for all the .EXE files) over and over again.
Try
If Not String.IsNullOrEmpty(TextBox1.Text) Then
If Directory.Exists(TextBox1.Text) Then
' Process.Start(tmpWhatRun, "/auto " & TextBox1.Text)
Dim startInfo As System.Diagnostics.ProcessStartInfo
Dim pStart As New System.Diagnostics.Pro开发者_StackOverflowcess
startInfo = New System.Diagnostics.ProcessStartInfo(tmpWhatRun, _
"/auto " & TextBox1.Text)
pStart.StartInfo = startInfo
pStart.Start()
pStart.WaitForExit()
Else : MsgBox("Invalid directory.")
End If
Else
Dim startInfo As System.Diagnostics.ProcessStartInfo
Dim pStart As New System.Diagnostics.Process
startInfo = New System.Diagnostics.ProcessStartInfo(tmpWhatRun)
pStart.StartInfo = startInfo
pStart.Start()
pStart.WaitForExit()
End If
Catch ex As Exception
End Try
I've seen some stuff about using Windows APIs but that seems like it could cause some problems since these are external programs not owned by my program.
Try to use 7zip or zlib for extracting your exe. They come with .Net examples
Jai, there are command line extensions for WinZip if you really want to use it, or you can try to do the same with WinRar.
精彩评论