Need Some Help With Visual Basic(VB)
#1

Hello SAMP Members


i Need Some Help With Visual Basic(VB) i want to make a Control panel Like
there will be 3 buttons
"Start Server
Stop Server
Restart Server"


I know the Code of Stop Server

But i dont know how to script Start Server And Restart Server :/
like what's the code when players clicks the first button which is Start Server
The Control panel seraches the Whole Computer And Find The samp-server.exe And opens it
Can someone give me the code for this

And Also The restart Server
It just Closes The samp-server.exe And Then Reopens It
I also need code for this

I will Be Very Very Happy if someone Help's Me
Reply
#2

well this is not a VB site!
you need to learn threw some other site how to invoke an exe file
search ****** or the likes...

and the restart will be a combo of both Shut-down && Start
Reply
#3

i know how to run a File but it wants The Path Of it Also
i dont want to specify file i just want it To Search The File Wherever it is and then Just Simply Open it?
Reply
#4

I don`t think you can do like this..to search on computer for samp-server.exe,becouse if you have many servers wich server will open?
You need to have the program and samp-server.exe in same folder and do like this

Код:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Process.Start("samp-server.exe")
    End Sub
And for closing it you can to like
Код:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim myprocess() As Process = System.Diagnostics.Process.GetProcessesByName("samp-server.exe")
        For Each myKill As Process In myprocess
            myKill.Kill()
        Next
That`s for button 1 and 2 you can change them..

And do you know that this is a forum for scripting?
Not for this :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)