Gooley Posted September 3, 2005 Posted September 3, 2005 Is there a way for an application to open other .exe files using an open file dialog? Say, to let the user browse for a .exe file, for example "aim.exe" and execute it? Much Appreciated. Quote
Leaders dynamic_sysop Posted September 3, 2005 Leaders Posted September 3, 2005 use System.Diagnostics.Process.Start eg: [color=blue]Private Sub[/color] SomeSub() [color=blue] Dim[/color] od [color=blue]As New[/color] OpenFileDialog [color=blue]With[/color] od .Filter = "Applications (*.exe)|*.exe" [color=blue]End With[/color] [color=blue]If[/color] od.ShowDialog = DialogResult.OK [color=blue]Then[/color] System.Diagnostics.Process.Start(od.FileName) [color=green]'/// od.FileName being the path of the .exe[/color] [color=blue]End If[/color] [color=blue]End Sub[/color] Quote
rot13 Posted September 5, 2005 Posted September 5, 2005 use System.Diagnostics.Process.Start eg: [color=blue]Private Sub[/color] SomeSub() [color=blue] Dim[/color] od [color=blue]As New[/color] OpenFileDialog [color=blue]With[/color] od .Filter = "Applications (*.exe)|*.exe" [color=blue]End With[/color] [color=blue]If[/color] od.ShowDialog = DialogResult.OK [color=blue]Then[/color] System.Diagnostics.Process.Start(od.FileName) [color=green]'/// od.FileName being the path of the .exe[/color] [color=blue]End If[/color] [color=blue]End Sub[/color] Why do you use With/End With for .Filter? :confused: thanks Quote
Gooley Posted September 5, 2005 Author Posted September 5, 2005 Why do you use With/End With for .Filter? :confused: thanks Yeah, it seems like a waste.. Quote
rot13 Posted September 5, 2005 Posted September 5, 2005 Yeah' date=' it seems like a waste..[/quote'] I'm just curious if there is something that With/End With does that I'm not thinking about... :confused: I just don't see why it would be put in for 1 property... so if it doesn't do anything special... yeah, its a waste.... lol Quote
Leaders dynamic_sysop Posted September 5, 2005 Leaders Posted September 5, 2005 probably because the code in my form originally had more than 1 line inside the With / End With statement :rolleyes: i did have various other options set like MultiSelect etc... but thought it easier to remove them and just leave the Filter ( incase you didn't understand the Filter property ) however , a point i'd love to state back. you are quick enough at asking for help, but the appreciation for help seems to have vanished :confused: maybe some of us are bought up to say thanks when helped by someone else & others are very quick at asking but never can be bothered to actually appreciate it :) before trying to slate someone else ( who was only trying to help you in his own free time / time he could have spent helping someone who actually respected the help ) try thinking about your own little un polite ways :D Quote
sgt_pinky Posted September 6, 2005 Posted September 6, 2005 I think dynamic_sysop has a very valid point. Obviously given his forum status he understands what a With statement is all about. And obviously you know how to remove it, so why not just thank him/her and be happy that someone has, in their own spare time, had the patience to help you. ;) Quote
Gooley Posted September 24, 2005 Author Posted September 24, 2005 I'm sorry, I wasn't going off on your coding techniques or anything. I included the word "Seems" in my reply, because I didn't know if you took it from something else or just what. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.