Jump to content

Ajuda com String


Recommended Posts


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()


      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


Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.