Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Posted

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.

~Nate�

___________________________________________

Please use the [vb]/[cs] tags on posted code.

Please post solutions you find somewhere else.

Follow me on Twitter here.

Posted

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.

Never trouble another for what you can do for yourself.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...