Showing posts with label SMS. Show all posts
Showing posts with label SMS. Show all posts

Thursday, 21 November 2013

HOw To Call URL API for SMS sending using function in C#.NET

Copy & Paste this code and call this function anywhere you use to use API:


 public void SendSMS()
        {
            //HTTP connection
            HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create("your url API");
            //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();

        }