using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Text;
using System.IO;
using System.Net;
using System.Data.SqlClient;

public partial class MobileSMS_Default : System.Web.UI.Page
{
    //string sentsms = "Wrong MPIN used. Account will be blocked on three wrong attempts";    
    //TID- XXXX , Your transaction for Mobile No. XXXX is going on pending . your login balance is Rs. XXXX. MPIN XXXX and send to XXXX 
    string mobno = "9045015003";//919723881503/M VT 8264105026 100 3282/GUJARAT IDEA 07-02-2013 05:24:48 AM
    protected void Page_Load(object sender, EventArgs e)
    {
        //SendSMS(mobno, sentsms);
        //Recharge mobile
        //Response.Redirect("Sms.aspx?msisdn=918527256197&sms=M ID 1234567890 10 9705&circle=UP WEST RELIANCE&opnm=GSM&datetime=25-10-2012 05:56:30 PM");
            Response.Redirect("Sms.aspx?msisdn=8527256197&sms=M AT 8527256197 1 1133 R&circle=UP WEST RELIANCE&opnm=GSM&datetime=25-10-2012 05:56:30 PM");
        //Set Mpin
        //Response.Redirect("Sms.aspx?msisdn=918439073119&sms=Mpin 1234&circle=UP WEST RELIANCE&opnm=GSM&datetime=25-10-2012 05:56:30 PM");
        //Check Balance user
        //Response.Redirect("Sms.aspx?msisdn=919761777949&sms=Bal&circle=UP WEST RELIANCE&opnm=GSM&datetime=25-10-2012 05:56:30 PM");
        //Check Balance user
        //Response.Redirect("Sms.aspx?msisdn=918527256197&sms=VENBAL&circle=UP WEST RELIANCE&opnm=GSM&datetime=25-10-2012 05:56:30 PM");
     }
    private void SendSMS(string MobileNo, string sms)
    {
        //string strUrl = "http://api.mVaayoo.com/mvaayooapi/MessageCompose?user=alliance@egenservices.com:8430082781&senderID=EGENTR&receipientno=" + MobileNo + "&msgtxt=" + sms + "&state=4";
        string strUrl = "http://sms.bulksms.co/instant1/web2sms.php?username=egen&password=egen@$ervice$09&to=" + MobileNo + "&sender=" + "RECHRG" + "&message=" + sms + "";
        WebRequest request = HttpWebRequest.Create(strUrl);
        request.Method = "GET";
        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();
    }
}
