Я нахожусь на VB.net и задаюсь вопросом, есть ли способ вызвать поиск из консольного приложения.Например, когда пользователь нажимает кнопку «Отмена» в поле ввода, он открывает браузер файлов для своего компьютера, позволяя ему выбрать место для сохранения файла.
Я прилагаю некоторый код, чтобы дать представление о том, что яя делаю
'If User Chooses to Auto Search Then
If StorName Is "" Then StorName = MsgBox("Please Choose the Location you would Like to Have the Information Written to")
'Shows msgbox stating to brose for location
Dim MsgBoxResultStor As Object
Dim StoragePlace As String
'??which Namespace etc to call??
MsgBoxResultStor =
StoragePlace = MsgBoxResultStor
StoragePlace = InputBox(MessageStor, TitleStor, StoragePlace)
ЗАКЛЮЧИТЕЛЬНОЕ РЕДАКТИРОВАНИЕ: вместо этого используется Save FileDialog, но та же идея.
Dim MyStream As Stream = Nothing
Dim SaveFileDialog1 As New SaveFileDialog()
Dim msgboxResult As Object
If StorName Is "" Then StorName = MsgBox("Please Choose the Location you would Like to Have the Information Written to")
If SaveFileDialog1.ShowDialog() = DialogResult.OK Then
MyStream = SaveFileDialog1.OpenFile()
If (MyStream IsNot Nothing) Then
MsgBoxResult = SaveFileDialog1.InitialDirectory
End If
End If