Label sms = new Label(); sms.Text = "Your Login Id is " + user_id + " and password is " + pass; string strUrl = "http://www.way2sms.com?user=user_id:pass&senderID=e&receipientno=9001233211&msgtxt= " + sms ; WebRequest request = HttpWebRequest.Create(strUrl); HttpWebResponse response = (HttpWebResponse)request.GetResponse(); Stream s = (Stream)response.GetResponseStream(); StreamReader readStream = new StreamReader(s); string dataString = readStream.ReadToEnd(); response.Close(); s.Close(); readStream.Close(); dbcon.closecon(); try { //Create the request and send data to Ozeki NG SMS Gateway Server by HTTP connection HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create(strUrl); //Get response from Ozeki NG SMS Gateway Server and read the answer HttpWebResponse myResp = (HttpWebResponse)myReq.GetResponse(); System.IO.StreamReader respStreamReader = new System.IO.StreamReader(myResp.GetResponseStream()); string responseString = respStreamReader.ReadToEnd(); respStreamReader.Close(); myResp.Close(); //inform the user //lblMessage.Visible = true; //lblMessage.Text = "Sent Successfully"; //textboxError.Visible = true; } catch (Exception ex) { //if sending request or getting response is not successful, Ozeki NG - SMS Gateway Server may not be running //lblMessage.Visible = true; //lblMessage.Text = " SMS Gateway Server is not running!" + "<br/>" + createdURL + ex.Message; //textboxError.Visible = true; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)