System.Object stringpost = "User=" + User + "&passwd=" + password + "&mobilenumber=" + Mobile_Number + "&message=" + Message + "&MType=" + Mtype + "&DR=" + DR + "&SID=" + SID; //string functionReturnValue = null; //functionReturnValue = ""; HttpWebRequest objWebRequest = null; HttpWebResponse objWebResponse = null; StreamWriter objStreamWriter = null; StreamReader objStreamReader = null; try { string stringResult = null; objWebRequest = (HttpWebRequest)WebRequest.Create("http://www.smscountry.com/SMSCwebservice.asp"); objWebRequest.Method = "POST"; if ((objProxy1 != null)) { objWebRequest.Proxy = objProxy1; } // Use below code if you want to SETUP PROXY. //Parameters to pass: 1. ProxyAddress 2. Port //You can find both the parameters in Connection settings of your internet explorer. //WebProxy myProxy = new WebProxy("YOUR PROXY", PROXPORT); //myProxy.BypassProxyOnLocal = true; //wrGETURL.Proxy = myProxy; objWebRequest.ContentType = "application/x-www-form-urlencoded"; objStreamWriter = new StreamWriter(objWebRequest.GetRequestStream()); objStreamWriter.Write(stringpost); objStreamWriter.Flush(); objStreamWriter.Close(); objWebResponse = (HttpWebResponse)objWebRequest.GetResponse(); objStreamReader = new StreamReader(objWebResponse.GetResponseStream()); stringResult = objStreamReader.ReadToEnd(); objStreamReader.Close(); return (stringResult); } catch (Exception ex) { return (ex.Message); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)