问题描述:

I was wondering if it is possible to get the HTML output of a PHP file using a C# Windows application.

I have already googled for this, but all I could find was a compiler where you could use PHP together with C#.

Is there any possibility to do this?

网友答案:

You can use HttpWebRequest - http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.aspx to get the HTML.

As everyone is suggesting to get output of local script: look into System.Diagnostics.Process.Start and related functions to run from command line. You can either dump output to file first and than read it with C# or redirect output (i.e. C# - Realtime console output redirection )

相关阅读:
Top