Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/268.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/amazon-s3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
我可以在PHP服务器上运行asp.net代码吗?_Php_Asp.net - Fatal编程技术网

我可以在PHP服务器上运行asp.net代码吗?

我可以在PHP服务器上运行asp.net代码吗?,php,asp.net,Php,Asp.net,我有一个使用Php的域,但我添加了asp.net代码。并尝试执行它只显示asp.net代码。是否可以使用任何插件或某些第三方帮助在php域下添加asp.net代码。如果是,请给出一些想法。您可以使用HttpWebRequest从PHP页面获得一个结果,这可能会对您有所帮助。例如: 否则,问题是IIS将看到一个.php文件并用php编译它。反之亦然。虽然在ASP.NET中运行PHP的一个解决办法是。如何使用HttpWebRequest,请选择在何处使用它只是更正了一些语法,使标题更加友好 stri

我有一个使用Php的域,但我添加了asp.net代码。并尝试执行它只显示asp.net代码。是否可以使用任何插件或某些第三方帮助在php域下添加asp.net代码。如果是,请给出一些想法。

您可以使用HttpWebRequest从PHP页面获得一个结果,这可能会对您有所帮助。例如:


否则,问题是IIS将看到一个.php文件并用php编译它。反之亦然。虽然在ASP.NET中运行PHP的一个解决办法是。

如何使用HttpWebRequest,请选择在何处使用它只是更正了一些语法,使标题更加友好
string myRequest = "abc=1&pqr=2&lmn=3";
string myResponse="";
string myUrl = "Where you want to post data";
System.IO.StreamWriter myWriter = null;// it will open a http connection with provided url
System.Net.HttpWebRequest objRequest = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(myUrl);//send data using     objxmlhttp object
objRequest.Method = "GET";
objRequest.ContentLength = TranRequest.Length;
objRequest.ContentType = "application/x-www-form-urlencoded";//to set content type
myWriter = new System.IO.StreamWriter(objRequest.GetRequestStream());
myWriter.Write(myRequest);//send data
myWriter.Close();//closed the myWriter object

System.Net.HttpWebResponse objResponse = (System.Net.HttpWebResponse)objRequest.GetResponse();//receive the responce from     objxmlhttp object 
using (System.IO.StreamReader sr = new     System.IO.StreamReader(objResponse.GetResponseStream()))
{
    myResponse= sr.ReadToEnd();
}