“Unable to connect to remote server fail” in HttpWebRequest

前端 未结 4 748
-上瘾入骨i
-上瘾入骨i 2021-01-07 09:47

I am using VSTS 2008 + C# + .Net 3.5 to develop a console application and I send request to another server (IIS 7.0 on Windows Server 2008). I find when the # of request thr

4条回答
  •  情话喂你
    2021-01-07 10:36

    I am using Visual Studio 2005. How to send an SMS, here is my code:

    IPHostEntry host;
    host = Dns.GetHostEntry(Dns.GetHostName());
    UriBuilder urlbuilder = new UriBuilder();
    urlbuilder.Host = host.HostName;
    urlbuilder.Port = 4719;
    string PhoneNumber = "9655336272";
    string message = "Just a simple text";
    string subject = "MMS subject";
    string YourChoiceofName = "victoria";
    urlbuilder.Query = string.Format("PhoneNumber=%2B" + PhoneNumber + "&MMSFrom=" + YourChoiceofName + "&MMSSubject=" + subject + "&MMSText=" + message);//+ "&MMSFile=http://127.0.0.1/" + fileName
    HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create(new Uri(urlbuilder.ToString(), false));
    HttpWebResponse httpResponse = (HttpWebResponse)(httpReq.GetResponse());
    

提交回复
热议问题