Jaxbot Posted May 2, 2008 Posted May 2, 2008 Hi, how do I run a program and get the results it sends? Shell returns the process ID, and I'm sure I just have the command wrong. Thanks :) EDIT: Here's what I mean: MsgBox(Shell("php c:\test1.php")) test1.php returns "MEH". I want that result in the msgbox. (I have a more complex use but that's the test part for now). Quote
techmanbd Posted May 2, 2008 Posted May 2, 2008 In .NET you don't use msgbox. You use messagebox.show("") Quote Live as if you were to die tomorrow. Learn as if you were to live forever. Gandhi
Jaxbot Posted May 2, 2008 Author Posted May 2, 2008 Thank you for the off topic, invaild, and otherwise pointless reply. Quote
Nate Bross Posted May 2, 2008 Posted May 2, 2008 Look into the System.Diagnostics namespace. This will allow you to start a process ("php") and you should be able to get the results. However, I am unaware of the abbility to run a php page w/out a web server running. Quote ~Nate� ___________________________________________ Please use the [vb]/[cs] tags on posted code. Please post solutions you find somewhere else. Follow me on Twitter here.
Jaxbot Posted May 2, 2008 Author Posted May 2, 2008 Thanks for the reply :) Yes, there is a way, using the PHP.exe. Quote
MrPaul Posted May 3, 2008 Posted May 3, 2008 See this thread Thank you for the off topic, invaild, and otherwise pointless reply. He's right, you should be using MessageBox.Show(). MsgBox and Shell are functions that only exist for backwards compatibility with VB6, and you should aim to move away from them in .NET applications. Back to the main question, the following thread has some code which you might find useful: Redirect Ping Output To A Textbox In The Form? It uses classes in the System.Diagnostics namespace as Nate Bross mentioned above. Quote Never trouble another for what you can do for yourself.
Jaxbot Posted May 3, 2008 Author Posted May 3, 2008 Re: See this thread Yes I saw that thread, and I got it working. Thanks ya'll. 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.