自己写的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());
}这样会弹出该php文件的源代码(除PHP语言之外),但就是没能执行该php文件原本发送邮件的功能。若用浏览器访问此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());
}这样会弹出该php文件的源代码(除PHP语言之外),但就是没能执行该php文件原本发送邮件的功能。若用浏览器访问此PHP文件,则可正常发送邮件。该怎么改呢?请高手指点!
解决方案 »
- 求一个字符串的处理方法
- 关于weifenluo,DockPanel的问题
- C# winform 单据保存.
- 请问如何用Flash制作网页菜单?急盼!在线等!谢谢!立即给分
- 水晶报表CrystalReportViewer问题
- 谁能给我一个求100到200之间的质数的和,让我参考下.
- [求助]asp.net怎么获得用post传过来的xml值?
- 谁用c#开发过飞环语音卡的给个范例呀
- 所有事件的基类在NET命名空间中的那里呀!
- 更换目录或更名是在操作文件分配表,如何操作??
- combox的数据源在绑定的情况下可以动态改变数据源吗
- 【急!急!急!关于XML文件读取】大家帮忙看看读取XML文件时这段代码是个干什么用的啊??
WebClient 吧。
可以帮你解决到你需要的问题
[呃,就是访问PHP,这个PHP可以判断是否需要发邮件(用JS代码判断),需要的话则调用发邮件的文件