HelpCF opener/ Is this code right?

Posts 1–8 of 8 · Page 1 of 1
CF opener/ Is this code right?
Hey i makeing a Crossfire NA opener "Patcher_CF" and i wanna know if this code is right or whats wrong with it?
Opener:
Code:
 Try
            Shell("cf_Patcher.exe")
            MsgBox("CrossFire Launched Success Made by @Stanman08")
        Catch ex As Exception
            MsgBox("Please Put Launcher On Crossfire Folder", MsgBoxStyle.Exclamation, "Made By: @Stanman08")
        End Try
Browse For path to open CF without putting in folder:
Code:
  OpenFileDialog2.Filter = "Exe files | *.exe"
        OpenFileDialog2.ShowDialog()
        GhostTextBox1.Text = OpenFileDialog2.FileName
OpenFileDialog2:
Code:
 Dim OFD As New OpenFileDialog
        If Not OFD.ShowDialog = DialogResult.Cancel Then
            GhostTextBox1.Text = System****.Path.GetFileName(OFD.FileName)
        End If
I want it so u dont have to put it in CF folders and you browse for the path like C:/Program/Z8Games/Crossfire/Patcher_CF
Help?
OpenFileDialog will let you choose the file to run/ do whatever you want.

Get its String from ofDialog.FileName (OpenFileDialog Object).

Use Process.Start(xxx) to run, profit?
Quote Originally Posted by 'Bruno View Post
OpenFileDialog will let you choose the file to run/ do whatever you want.

Get its String from ofDialog.FileName (OpenFileDialog Object).

Use Process.Start(xxx) to run, profit?



What do you mean?
.....
I want it so You browser for The Patcher_CF and when u click Open CF (Which is Button1)
It will open.



Edit------------------------------------------------------------------------------------------------------------------
This is button1
Code:
 Try
            Shell("Patcher_CF.exe")
            MsgBox("CrossFire Launched Success Made by 
 @Stanman08
")
        Catch ex As Exception
            MsgBox("Please Put Launcher On Crossfire Folder", MsgBoxStyle.Exclamation, "Made By: 
 @Stanman08
")
        End Try
Erm... you need to learn VB. He already answered your question... OpenFileDialog
So basically, you want the filedialog to show a directory right when it pops up?

Just do

Code:
OpenFileDialog2.InitialDirectory = "C:/Program/Z8Games/Crossfire/Patcher_CF"
OpenFileDialog2.ShowDialog()
GhostTextBox1.Text = OpenFileDialog2.FileName
Quote Originally Posted by Cryptonic View Post
So basically, you want the filedialog to show a directory right when it pops up?

Just do

Code:
OpenFileDialog2.InitialDirectory = "C:/Program/Z8Games/Crossfire/Patcher_CF"
OpenFileDialog2.ShowDialog()
GhostTextBox1.Text = OpenFileDialog2.FileName
this is not the correct way of doing things, not everyone has the same installation folder / C drive / Program files, etc
Quote Originally Posted by 'Bruno View Post


this is not the correct way of doing things, not everyone has the same installation folder / C drive / Program files, etc
Of course, but I think that this is what he's asking.
Quote Originally Posted by Cryptonic View Post


Of course, but I think that this is what he's asking.
I was talking in general, to the thread/op, saying that because he shouldn't do it (in case it is what he wants)
Posts 1–8 of 8 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us