当前位置: 动力学知识库 > 问答 > 编程问答 >

Get output of PHP script from C#

问题描述:

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 )

分享给朋友:
您可能感兴趣的文章:
随机阅读: