Source code:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Shibashish mohanty</title>
<style type="text/css">
.style1
{
width: 34%;
height: 99px;
}
.style2
{
width: 133px;
}
.style3
{
width: 35px;
}
.style4
{
width: 26px;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div align="center" >
<table class="style1"
style="background-position: center center; border: thick solid #C0C0C0;"
bgcolor="#336600">
<tr>
<td class="style4" style="color: #FFFFFF">
To:</td>
<td class="style2">
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox></td>
<td class="style3">
</td>
<td style="color: #FFFFFF">
Msg:</td>
<td>
<asp:TextBox ID="TextBox2" TextMode="MultiLine" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td class="style4">
</td>
<td class="style2">
</td>
<td class="style3">
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td class="style4">
</td>
<td class="style2">
</td>
<td class="style3">
<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Send" />
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td class="style4">
</td>
<td class="style2">
</td>
<td class="style3">
</td>
<td>
</td>
<td>
</td>
</tr>
</table>
<br />
<table class="style1"
style="background-position: center center; border: thick solid #990000; position: fixed; border-collapse: collapse; display: block; background-color: #333300; top: 188px; left: 461px;">
<tr>
<td class="style4" style="color: #FFFFFF">
UserID:</td>
<td class="style2">
<asp:TextBox ID="TextBox3" runat="server"></asp:TextBox></td>
<td class="style3">
</td>
<td style="color: #FFFFFF">
Password:</td>
<td>
<asp:TextBox ID="TextBox4" TextMode="Password" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td class="style4">
</td>
<td class="style2">
</td>
<td class="style3">
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td class="style4">
</td>
<td class="style2">
</td>
<td class="style3">
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td class="style4">
</td>
<td class="style2">
</td>
<td class="style3">
</td>
<td>
</td>
<td>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Shibashish mohanty</title>
<style type="text/css">
.style1
{
width: 34%;
height: 99px;
}
.style2
{
width: 133px;
}
.style3
{
width: 35px;
}
.style4
{
width: 26px;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div align="center" >
<table class="style1"
style="background-position: center center; border: thick solid #C0C0C0;"
bgcolor="#336600">
<tr>
<td class="style4" style="color: #FFFFFF">
To:</td>
<td class="style2">
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox></td>
<td class="style3">
</td>
<td style="color: #FFFFFF">
Msg:</td>
<td>
<asp:TextBox ID="TextBox2" TextMode="MultiLine" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td class="style4">
</td>
<td class="style2">
</td>
<td class="style3">
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td class="style4">
</td>
<td class="style2">
</td>
<td class="style3">
<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Send" />
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td class="style4">
</td>
<td class="style2">
</td>
<td class="style3">
</td>
<td>
</td>
<td>
</td>
</tr>
</table>
<br />
<table class="style1"
style="background-position: center center; border: thick solid #990000; position: fixed; border-collapse: collapse; display: block; background-color: #333300; top: 188px; left: 461px;">
<tr>
<td class="style4" style="color: #FFFFFF">
UserID:</td>
<td class="style2">
<asp:TextBox ID="TextBox3" runat="server"></asp:TextBox></td>
<td class="style3">
</td>
<td style="color: #FFFFFF">
Password:</td>
<td>
<asp:TextBox ID="TextBox4" TextMode="Password" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td class="style4">
</td>
<td class="style2">
</td>
<td class="style3">
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td class="style4">
</td>
<td class="style2">
</td>
<td class="style3">
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td class="style4">
</td>
<td class="style2">
</td>
<td class="style3">
</td>
<td>
</td>
<td>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
Code Behind:-
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Net;
using System.IO;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
public void send(string uid, string password, string message, string no)
{
HttpWebRequest myReq =
(HttpWebRequest)WebRequest.Create("http://ubaid.tk/sms/sms.aspx?uid=" + uid + "&pwd=" + password +
"&msg=" + message + "&phone=" + no + "&provider=way2sms");
HttpWebResponse myResp = (HttpWebResponse)myReq.GetResponse();
System.IO.StreamReader respStreamReader = new System.IO.StreamReader(myResp.GetResponseStream());
string responseString = respStreamReader.ReadToEnd();
respStreamReader.Close();
myResp.Close();
}
protected void Button1_Click(object sender, EventArgs e)
{
send(TextBox3.Text,TextBox4.Text, TextBox2.Text, TextBox1.Text);
}
}
Thanks Shibashish mohanty
spider : it's work very fine...and very fast
ReplyDeletePlease help me it is not working 30venadesh@gmail.com please help me.
DeleteThanks Spider
ReplyDeletehi firend its working
ReplyDeleteThanks dear to view my page
ReplyDeleteits not working for me
ReplyDeleteIts working Now I forgot to add reference Thanks Dude
Deleteu r most welcome
Deletewhat is that add reference thing
Deletewhich refernce we need to add? its not working for me too..
Deletereference ?? Qhich one? plz help my program runs but not send any msg. plz help...
Deletewhat is the use of following code ?????
ReplyDeleteHttpWebResponse myResp = (HttpWebResponse)myReq.GetResponse();
System.IO.StreamReader respStreamReader = new System.IO.StreamReader(myResp.GetResponseStream());
string responseString = respStreamReader.ReadToEnd();
responsestring ra kama kan mu bujhi paruni thik se....so plz help me out,
DeleteWe are requesting something thats why
ReplyDeletebut what is the advantage putting thar responsereader into string;
Deleteseithi tike doubt rahijauchhi.....what if we dont write string responseString = respStreamReader.ReadToEnd();
We have to read/check that userid and password which is not set in your local database it is fetched from way to sms database.Thats the reason.i thinks that was your doubt.Thanks for your valuable comment. Further any doubt Feel free to call me.
ReplyDeletehi shibashish i used ur code but it does not work error shows in httpresponse....
ReplyDeletetry this one
Deletehttp://shibashishdotnetocean.blogspot.in/2012/01/send-sms-to-mobile-in-aspnet-using.html
Where i find sms dll?
ReplyDeleteHi Shibashish I used your code its not working, the code which in return is coming is -11.
ReplyDeleteKindly please let me know whats wrong
Hi Shibashish... I have used your code but does not working and not even giving any error. Connection Length is giving as -1.
ReplyDeleteCan you please suggest any solution.
This is my latest post please go for it,its working fine
ReplyDeletehttp://shibashishdotnetocean.blogspot.in/2013/04/send-free-sms-using-aspnet-source-code.html
i have posted the latest one please go for it,its working fine http://shibashishdotnetocean.blogspot.in/2013/04/send-free-sms-using-aspnet-source-code.html
ReplyDelete