我已经实现了一个 CRM 2011 插件,它在创建时向主电话记录发送短信。但是我收到一条错误消息“无法连接到远程服务器”。下面是插件中使用的一段代码。
public static void send(string uid, string password, string message, string no)
{
HttpWebRequest myReq =
(HttpWebRequest)WebRequest.Create("http://ubaid.tk/sms/sms.aspx?uid=" + uid + "&pwd=" + password +
"&msg=" + message + "&phone=" + no + "&provider=way2sms");
HttpWebResponse myResp = (HttpWebResponse)myReq.GetResponse(); //Getting error in this line
System.IO.StreamReader respStreamReader = new System.IO.StreamReader(myResp.GetResponseStream());
string responseString = respStreamReader.ReadToEnd();
respStreamReader.Close();
myResp.Close();
}
解决此错误的解决方案是什么?