如何让它发挥作用?
当我按下按钮时,我的游戏开始时已经输入了ip。
我的代码:
Public Class Form1
Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
Form2.Show()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim startInfo As ProcessStartInfo = New ProcessStartInfo(My.Settings.SaveFiveM)
startInfo.Arguments = "+connect " & My.Settings.SaveIp
Process.Start(startInfo)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Process.Start(My.Settings.SaveDiscord)
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Process.Start("http://www.website.net/")
End Sub
End Class
但游戏开始但没有ip
在我的form2中,我有一个带有ip的文本框,这就是我所拥有的信息“My.Settings.SaveIp”
谢谢
对不起我的英语我是法国人
答案 0 :(得分:0)
要获取文件目录,只需使用FolderBrowserDialog
。
在您的控件列表中,双击FolderBrowserDialog
,然后创建一个名为FolderBrowserDialog1
的
然后,您可以根据自己的按钮和变量名称调整此代码
Dim DiscordPath As String
Private Sub btnSetDiscordDirectory_Click(sender As Object, e As EventArgs) Handles btnSetDiscordDirectory.Click
Dim folderSearchResult As DialogResult = FolderBrowserDialog1.ShowDialog
If Not folderSearchResult = DialogResult.Cancel Then
DiscordPath = IO.Path.Combine(FolderBrowserDialog1.SelectedPath, "Discord.exe")
End If
End Sub