2

我正在 Visual Basic Express Edition 2010 中制作 Crypter,但遇到了一些问题。我正在尝试使用户单击 GUI 中的按钮,并允许他们选择要 Crypt 的文件。有没有人对如何做到这一点有任何想法?这是我最初用来制作它的代码,但它不起作用:(感谢所有帮助!

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles Button1.Click
    With OpenFileDialog1
        .FileName = ""
        .Filter = "Executables (*.exe)|*.exe|All files (*.*)|*.*"
        .Title = "The Justice Crypter"
        .ShowDialog()
        TextBox1.Text = .FileName
        infectedfile = TextBox1.Text
    End With
End Sub

多谢你们。

4

2 回答 2

1

OpenFileDialog 是对我有用的 Win32 控件的 WPF 包装器。

Class MainWindow 
    Dim WithEvents openFileDialog1 As New Microsoft.Win32.OpenFileDialog
    Private Sub Button1_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles Button1.Click
        With OpenFileDialog1
            .FileName = ""
            .Filter = "Executables (*.exe)|*.exe|All files (*.*)|*.*"
            .Title = "The Justice Crypter"
            .ShowDialog()
            TextBox1.Text = .FileName
            'infectedfile = TextBox1.Text
        End With
    End Sub
End Class
于 2012-10-21T01:28:30.673 回答
0

OpenFileDialog1一片空白。
您需要将其初始化为New OpenFileDialog().

于 2012-10-21T01:24:53.847 回答