Sample code – CS

Image Description
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Web;
using System.Web.Mvc;

namespace EAPI.Controllers
{
    public class Sample_CS : Controller
    {
        //
        // GET: /Test2/
        public ActionResult Index(String username, String password, String src, String dst, String msg, String dr)
        {
            String url = "http://sms.textware.lk:5000/sms/send_sms.php?username=xxxxx&password=yyyyyy&src=aaaaaa&dst=94702576095&msg=Test&dr=1";
            String url2 = "http://sms.textware.lk:5000/sms/send_sms.php?username=" + username + "&password=" + password + "&src=" + src + "&dst=" + dst + "&msg=" + msg + "&dr=" + dr + "";
            var request = (HttpWebRequest)WebRequest.Create(url);
            WebResponse response = request.GetResponse();
           // Logger.Info(uuid + " Message sent to ESMS");
            StreamReader reader = new StreamReader(response.GetResponseStream());
            string responseText = reader.ReadToEnd();
            Console.WriteLine(responseText);

            return Content("response: " + responseText);
        }
	}
}

Was this article helpful to you?

Yes No

Related Articles