JimmyHsiao
2006-04-10 03:37:02 UTC
ASP
send.asp 內容
<%Response.write Request("msg")%>
2003 C# 內容
string smsURL = "http://127.0.0.1", smsURLVar = "/sms/send.asp?msg=主機發生異常";
System.Uri baseuri = new Uri(smsURL, true);
System.Uri uri = new Uri(baseuri, smsURLVar, true);
WebRequest req = HttpWebRequest.Create(uri);
req.Method = "GET";
req.ContentType = "application/x-www-form-urlencoded";
WebResponse rep = req.GetResponse();
Stream ReceiveStream = rep.GetResponseStream();
Encoding encode = System.Text.Encoding.Default;
StreamReader readStream = new StreamReader( ReceiveStream, encode );
string ret_code = readStream.ReadLine();
MessageBox.Show(ret_code);
結果 ret_code 會出現 ??????, 請問一下那裡沒有做對, 感謝
send.asp 內容
<%Response.write Request("msg")%>
2003 C# 內容
string smsURL = "http://127.0.0.1", smsURLVar = "/sms/send.asp?msg=主機發生異常";
System.Uri baseuri = new Uri(smsURL, true);
System.Uri uri = new Uri(baseuri, smsURLVar, true);
WebRequest req = HttpWebRequest.Create(uri);
req.Method = "GET";
req.ContentType = "application/x-www-form-urlencoded";
WebResponse rep = req.GetResponse();
Stream ReceiveStream = rep.GetResponseStream();
Encoding encode = System.Text.Encoding.Default;
StreamReader readStream = new StreamReader( ReceiveStream, encode );
string ret_code = readStream.ReadLine();
MessageBox.Show(ret_code);
結果 ret_code 會出現 ??????, 請問一下那裡沒有做對, 感謝