Inherits System.Web.UI.Page
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim the_rar As String
Dim the_Reg As RegistryKey
Dim the_Obj As Object
Dim the_Info As String
Dim the_StartInfo As ProcessStartInfo
Dim the_Process As Process
Try
the_Reg = Registry.ClassesRoot.OpenSubKey("Applications\WinRAR.exe\Shell\Open\Command")
the_Obj = the_Reg.GetValue("")
the_rar = the_Obj.ToString()
the_Reg.Close()
the_rar = the_rar.Substring(1, the_rar.Length - 7)
the_Info = " a " + " test.rar " + " " + "C:\test\test.txt"
the_StartInfo = New ProcessStartInfo()
the_StartInfo.FileName = the_rar
the_StartInfo.Arguments = the_Info
the_StartInfo.WindowStyle = ProcessWindowStyle.Hidden
the_StartInfo.WorkingDirectory = "C:\test\"
the_Process = New Process()
the_Process.StartInfo = the_StartInfo
the_Process.Start()
Response.Write("<script>alert('Zip Successfully');</script>")
Catch ex As Exception
Response.Write("<script>alert('Zip Failed.')</script>")
End Try
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
End Sub
Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim the_rar As String
Dim the_Reg As RegistryKey
Dim the_Obj As Object
Dim the_Info As String
Dim the_StartInfo As ProcessStartInfo
Dim the_Process As Process
Try
the_Reg = Registry.ClassesRoot.OpenSubKey("Applications\WinRAR.exe\Shell\Open\Command")
the_Obj = the_Reg.GetValue("")
the_rar = the_Obj.ToString()
the_Reg.Close()
the_rar = the_rar.Substring(1, the_rar.Length - 7)
the_Info = " X " + " test.rar " + " " + "C:\test"
the_StartInfo = New ProcessStartInfo()
the_StartInfo.FileName = the_rar
the_StartInfo.Arguments = the_Info
the_StartInfo.WindowStyle = ProcessWindowStyle.Hidden
the_StartInfo.WorkingDirectory = "C:\test\"
the_Process = New Process()
the_Process.StartInfo = the_StartInfo
the_Process.Start()
Response.Write("<script>alert('Zip Successfully');</script>")
Catch ex As Exception
Response.Write("<script>alert('Zip Failed.')</script>")
End Try
End Sub
End Class