a3deluxe Posted April 28, 2022 at 09:14 AM Report Share #625861 Posted April 28, 2022 at 09:14 AM Olá, Precisava de uma ajuda no seguinte: Nesta String Game, procura na drive C:\os ficheiros com números exes(1.exe,2.exe,3.exe… até 8.exe) Agora queria substituir e converter a String.Format("C:\{0}.exe", SelectedGame) pelas classes (Private sub H20(), Private sub H30()) para procurar pelas classes em vez de procurar pelos ficheiros exe na drive c:\ Dim Game As String = String.Format("C:\{0}.exe", SelectedGame) Private Sub SetSelectedGame(ByVal Game As Integer) If 1 <= Game And Game <= 8 Then SelectedGame = Game SelectedGameLabel.Text = SelectedGame.ToString() SetImages() End If End Sub Private Sub SetImages() If SelectedGame = "1" SelectTop.Image = My.Resources.h20t SelectCenter.Image = My.Resources.h20c BackgroundImage = My.Resources.h20b ElseIf SelectedGame = "2" SelectTop.Image = My.Resources.h30t SelectCenter.Image = My.Resources.h30c BackgroundImage = My.Resources.h30b End If …… End Sub Private Sub H20() ‘ Subtitui o ficheiro 1.exe Process.Start("cmd", "/c start /d D:\h30\ /wait D:\H20\start.exe -noconsole") End Sub Private Sub H30() ‘ Subtitui o ficheiro 2.exe Process.Start("cmd", "/c start /d D:\h30\ /wait D:\H30\start.exe -noconsole") End Sub Obrigado Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now