C#如何通过Apache访问PHP文件?
自己写的C#代码如下:
static string RegularFlowURL = "http://127.0.0.1/flowserver/html/menu_detail.php";public static void Check(){ try { System.Net.ServicePointManager.Expect100Continue = false; Stream instream = null; StreamReader sr = null; HttpWebResponse response = null; HttpWebRequest request = null; Encoding encoding = Encoding.UTF8; request = WebRequest.Create(RegularFlowURL) as HttpWebRequest; response = request.GetResponse() as HttpWebResponse; instream = response.GetResponseStream(); sr = new StreamReader(instream, encoding); string content = sr.ReadToEnd(); MessageBox.Show(content); } catch (Exception ee) { MessageBox.Show(ee.ToString()); }