VB.net调用的小问题,偶太菜解决不了
如在 cmd中 用命令 regsvr32.exe 可以注册和反注册那些dll,ocx控件
在VB.net 的shell 怎么实现如要注册路径为 C:\win.dll 控件,而路径是用OpenFileDialog1选择
如
Private Sub Bt选择_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Bt选择.Click
OpenFileDialog1.Title = "选择文件"
OpenFileDialog1.Filter = "所有文件(*.*)|*.*"
OpenFileDialog1.ShowDialog()
Me.TextBox1.Text = OpenFileDialog1.FileName
End Sub
Private Sub Bt注册_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Bt注册.Click
If Me.TextBox1.Text = "" Then
MessageBox.Show("请选择文件!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
Exit Sub
End If
Try
System.Diagnostics.Process.Start("cmd.exe /c regsvr32.exe " & Me.TextBox注册.Text)
Catch ex As Exception
MsgBox(ex.Message)
Me.TextBox1.Text = ""
End Try
End Sub
应该是错在这 System.Diagnostics.Process.Start("cmd.exe /c regsvr32.exe " & Me.TextBox注册.Text),
但不知怎么写呢