Escolar Documentos
Profissional Documentos
Cultura Documentos
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.ConIiguration;
using System.Net;
using System.IO;
public partial class login : System.Web.UI.Page
protected void PageLoad(object sender, EventArgs e)
}
protected void Button1Click(object sender, EventArgs e)
Session|"kk"| TextBox1.Text;
SqlConnection conn;
String str ConIigurationManager.ConnectionStrings|"hm"|.ConnectionString;
conn new SqlConnection(str);
//SqlDataAdapter da new SqlDataAdapter("select * Irom register where mobileno'"
TextBox1.Text "' and password'" TextBox.Text "'",constr);
conn.Open();
SqlCommand d new SqlCommand("select * Irom register where mobileno'"
TextBox1.Text "' and password'" TextBox.Text "'", conn);
d.ExecuteNonQuery();
SqlDataReader dr d.ExecuteReader();
iI (dr.Read())
string name dr.GetString(0);
31
Session|"name"| name;
Response.Redirect("aIterlogin.aspx");
}
else
Label1.Visible true;
}
}
protected void ButtonClick(object sender, EventArgs e)
iI (TextBox6.Text "")
Response.Write("script~alert('Enter the phone no.')/script~");
}
else iI (TextBox7.Text "")
Response.Write("script~alert('Enter the password')/script~");
}
else iI (TextBox8.Text "")
Response.Write("script~alert('ConIirm the password')/script~");
}
else
SqlConnection conn;
String str ConIigurationManager.ConnectionStrings|"hm"|.ConnectionString;
conn new SqlConnection(str);
conn.Open();
SqlCommand ccc new SqlCommand("select * Irom register where mobileno'"
TextBox6.Text "'", conn);
SqlDataReader dr ccc.ExecuteReader();
iI (dr.Read())
Label.Visible true;
conn.Close();
}
else
SqlConnection conne;
3
String strg ConIigurationManager.ConnectionStrings|"hm"|.ConnectionString;
conne new SqlConnection(strg);
conne.Open();
SqlCommand cc new SqlCommand("insert into register values('" TextBox3.Text
"','" TextBox4.Text "','" RadioButtonList1.SelectedItem.Text "','" TextBox5.Text "','"
TextBox6.Text "','" TextBox7.Text "','" TextBox8.Text "','"
DropDownList1.SelectedItem.Text "','" TextBox9.Text "')", conne);
cc.ExecuteNonQuery();
conne.Close();
string strUrl
"http://api.mVaayoo.com/mvaayooapi/MessageCompose?userjaindewank91gmail.com:nitin1
3&senderIDTEST SMS&receipientno" TextBox6.Text "&msgtxtYou have been
successIully registered on sms4chat.com..iI you have not registered then send us email at
supportsms4chat.com&state1";
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();
Response.Redirect("aIterregister.aspx");
}
}
}
protected void Button3Click(object sender, EventArgs e)
Response.Redirect("Iorgetpass.aspx");
}
}
33
1. QUICK SMS PAGE
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;
using System.Data.SqlClient;
using System.ConIiguration;
public partial class aIterlogin : System.Web.UI.Page
protected void PageLoad(object sender, EventArgs e)
// Label1.Text Request.QueryString.Get("name");
// Label.Text Request.QueryString.Get("mobileno");
Label1.Text Session|"name"|.ToString();
Label.Text Session|"kk"|.ToString();
}
protected void Button1Click(object sender, EventArgs e)
iI (TextBox1.Text "")
Response.Write("script~alert('Enter the phone no.')/script~");
}
string strUrl
"http://api.mVaayoo.com/mvaayooapi/MessageCompose?userjaindewank91gmail.com:nitin1
3&senderIDTEST SMS&receipientno" TextBox1.Text "&msgtxt" Label.Text
TextBox.Text "-sms4chat.com&state1";
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();
34
readStream.Close();
Label3.Visible true;
SqlConnection conn;
String str ConIigurationManager.ConnectionStrings|"hm"|.ConnectionString;
conn new SqlConnection(str);
conn.Open();
SqlCommand cc new SqlCommand("insert into sentmessage1 values('" TextBox1.Text
"','" TextBox.Text "','" Session|"kk"| "')", conn);
cc.ExecuteNonQuery();
conn.Close();
}
protected void CheckBoxList1SelectedIndexChanged(object sender, EventArgs e)
TextBox1.Text string.Join(",", (Irom ListItem item in CheckBoxList1.Items where
item.Selected select item.Value).ToArray());
}
}
35
1.3 QUICK CONTACTS PAGE
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.ConIiguration;
public partial class contacts : System.Web.UI.Page
protected void PageLoad(object sender, EventArgs e)
//string s;
//s Session|"kk"|.ToString();
}
protected void Button1Click(object sender, EventArgs e)
SqlConnection conn;
String str ConIigurationManager.ConnectionStrings|"hm"|.ConnectionString;
conn new SqlConnection(str);
conn.Open();
SqlCommand cc new SqlCommand("insert into contacts values('" TextBox1.Text "','"
TextBox.Text "','" Session|"kk"| "')", conn);
cc.ExecuteNonQuery();
Label1.Visible true;
conn.Close();
}
}
36
1.4 SENT MESSAGE PAGE
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.ConIiguration;
public partial class sentsms : System.Web.UI.Page
protected void PageLoad(object sender, EventArgs e)
}
protected void Button1Click(object sender, EventArgs e)
SqlConnection conn;
String str ConIigurationManager.ConnectionStrings|"hm"|.ConnectionString;
conn new SqlConnection(str);
conn.Open();
SqlCommand cmd new SqlCommand("delete Irom sentmessage1 where
message'"CheckBoxList1.SelectedItem.Text"'", conn);
cmd.ExecuteNonQuery();
}
}
37
1.5 GMAIL CONNECTIVITY PAGE
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Net.Mail;
using System.Net;
public partial class gmail : System.Web.UI.Page
protected void PageLoad(object sender, EventArgs e)
}
protected void Button1Click(object sender, EventArgs e)
SendEmail(TextBox3.Text.Trim(), TextBox6.Text, TextBox7.Text, TextBox4.Text.Trim(),
TextBox5.Text.Trim(), MailPriority.High, Ialse);
}
private void SendEmail(string toAddress, string ccAddress, string bccAddress, string subject,
string body, MailPriority priority, bool isHtml)
try
using (SmtpClient smtpClient new SmtpClient())
using (MailMessage message new MailMessage())
MailAddress IromAddress new MailAddress(TextBox1.Text, TextBox1.Text);
// You can speciIy the host name or ipaddress oI your server
smtpClient.Host "smtp.gmail.com"; //you can also speciIy mail server IP address
here
//DeIault port will be 5
smtpClient.Port 587;
NetworkCredential inIo new NetworkCredential(TextBox1.Text,TextBox.Text);
smtpClient.DeliveryMethod SmtpDeliveryMethod.Network;
smtpClient.UseDeIaultCredentials Ialse;
38
smtpClient.Credentials inIo;
//From address will be given as a MailAddress Object
message.From IromAddress;
message.Priority priority;
// To address collection oI MailAddress
message.To.Add(TextBox3.Text);
message.Subject subject;
iI (ccAddress.Length ~ 0)
message.CC.Add(ccAddress);
}
iI (bccAddress.Length ~ 0)
message.Bcc.Add(bccAddress);
}
//Body can be Html or text Iormat
//SpeciIy true iI it is html message
message.IsBodyHtml isHtml;
// Message body content
message.Body body;
// Add the attachment, iI any
iI (FileUpload1.HasFile)
string Path "/data/" FileUpload1.FileName;
FileUpload1.SaveAs(MapPath(Path));
Attachment attachment new Attachment(Server.MapPath(Path));
message.Attachments.Add(attachment);
}
// Send SMTP mail
smtpClient.EnableSsl true;
smtpClient.Send(message);
Label1.Text "Email sent successIully !";
Label1.Visible true;
}
}
}
39
catch (Exception ee)
Label1.Text ee.ToString();
Label1.Visible true;
}
}
}
40
1.6 PROFILE PAGE
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.ConIiguration;
public partial class proIile : System.Web.UI.Page
protected void PageLoad(object sender, EventArgs e)
SqlConnection conn;
String str ConIigurationManager.ConnectionStrings|"hm"|.ConnectionString;
conn new SqlConnection(str);
conn.Open();
SqlCommand cca new SqlCommand("select Iullname,dob,gender,mobileno Irom register
where mobileno'" Session|"kk"| "'", conn);
cca.ExecuteNonQuery();
SqlDataReader dr cca.ExecuteReader();
iI (dr.Read())
string a dr.GetString(0);
TextBox1.Text a;
string b dr.GetString(1);
TextBox.Text b;
string c dr.GetString();
TextBox3.Text c;
TextBox4.Text Session|"kk"|.ToString();
}
else
}
}
protected void Button1Click(object sender, EventArgs e)
41
SqlConnection conn;
String str ConIigurationManager.ConnectionStrings|"hm"|.ConnectionString;
conn new SqlConnection(str);
conn.Open();
SqlCommand d new SqlCommand("select * Irom register where password'"
TextBox5.Text "'", conn);
SqlDataReader dr d.ExecuteReader();
iI (dr.Read())
dr.Close();
SqlCommand dI new SqlCommand("update register set password'" TextBox6.Text
"',cnIrmpass'" TextBox7.Text "' where password'" TextBox5.Text "'", conn);
dI.ExecuteNonQuery();
Label1.Visible true;
}
else
Label.Visible true;
}
}
}
4
1.7 SMSSTORE PAGE
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Web.UI.HtmlControls;
using DataSet1TableAdapters;
using System.ConIiguration;
using System.Data.SqlClient;
public partial class smsstore : System.Web.UI.Page
protected void PageLoad(object sender, EventArgs e)
string a HttpUtility.HtmlEncode(Request.Params|"categoryid"|);
iI (a null)
a "1";
}
// Response.Write(a);
int b Convert.ToInt3(HttpUtility.HtmlEncode(Request.Params|"pageindex"|));
iI (b 1 ,, b ~ 10)
b 1;
}
int startIndex (b - 1) * 10 1;
int endIndex b * 10;
SqlConnection conn;
String str ConIigurationManager.ConnectionStrings|"hm"|.ConnectionString;
conn new SqlConnection(str);
conn.Open();
SqlCommand Iirstquery new SqlCommand("select * Irom (SELECT ROWNUMBER()
OVER (ORDER BY messageid ASC) as Row, messageid, categoryid, message, images, tags,
sent, popularity, up, down, messagelength FROM messages where categoryid'" a "')
messages where Row ~'" startIndex "' and Row '" endIndex "'", conn);
43
SqlCommand secondquery new SqlCommand("select categoryid, name, (select count(*)
Irom messages where messages.categoryidcategories.categoryid) as ProductCount Irom
categories", conn);
Iirstquery.ExecuteNonQuery();
secondquery.ExecuteNonQuery();
DataSet s new DataSet();
DataSet r new DataSet();
SqlDataAdapter o new SqlDataAdapter("select * Irom (SELECT ROWNUMBER()
OVER (ORDER BY messageid ASC) as Row, messageid, categoryid, message, images, tags,
sent, popularity, up, down, messagelength FROM messages where categoryid'" a "')
messages where Row ~'" startIndex "' and Row '" endIndex "'", conn);
SqlDataAdapter p new SqlDataAdapter("select categoryid, name, (select count(*) Irom
messages where messages.categoryid'" a "') as ProductCount Irom categories", conn);
o.Fill(s);
p.Fill(r);
Ltest.Text s.Tables|0|.Rows|0||"message"|.ToString();
Label1.Text s.Tables|0|.Rows|1||"message"|.ToString();
Label.Text s.Tables|0|.Rows|||"message"|.ToString();
Label3.Text s.Tables|0|.Rows|3||"message"|.ToString();
Label4.Text s.Tables|0|.Rows|4||"message"|.ToString();
Label5.Text s.Tables|0|.Rows|5||"message"|.ToString();
Label6.Text s.Tables|0|.Rows|6||"message"|.ToString();
Label7.Text s.Tables|0|.Rows|7||"message"|.ToString();
Label8.Text s.Tables|0|.Rows|8||"message"|.ToString();
Label9.Text s.Tables|0|.Rows|9||"message"|.ToString();
//Label10.Text r.Tables|0|.Rows|0||"ProductCount"|.ToString();
string navigationFormat "smsstore.aspx?categoryid0}&pageindex1}";
PreviousPageNav.HReI String.Format(navigationFormat, a, b-1);
PreviousPageNav.Visible (b ~ 0) ? true : Ialse;
int totalpages Convert.ToInt3(r.Tables|0|.Rows|0||"ProductCount"|) / 10;
iI (b 1 totalpages)
NextPageNav.HReI String.Format(navigationFormat, a, b 1);
}
else
NextPageNav.HReI String.Format(navigationFormat, a, totalpages);
}
}}
44
1.8 FORGET PASSWORD PAGE
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.ConIiguration;
public partial class Iorgetpass : System.Web.UI.Page
protected void PageLoad(object sender, EventArgs e)
}
protected void Button1Click(object sender, EventArgs e)
SqlConnection conn;
String str ConIigurationManager.ConnectionStrings|"hm"|.ConnectionString;
conn new SqlConnection(str);
conn.Open();
SqlCommand d new SqlCommand("select * Irom register where mobileno'"
TextBox1.Text "' and securityques'" DropDownList1.SelectedItem.Text "' and answer'"
TextBox.Text "'", conn);
d.ExecuteNonQuery();
SqlDataReader dr d.ExecuteReader();
iI (dr.Read())
Label3.Visible true;
TextBox3.Visible true;
Button.Visible true;
Label1.Visible Ialse;
}
else
Label1.Visible true;
}
45
} protected void ButtonClick(object sender, EventArgs e)
SqlConnection conn;
String str ConIigurationManager.ConnectionStrings|"hm"|.ConnectionString;
conn new SqlConnection(str);
conn.Open();
SqlCommand cmd new SqlCommand("update register set password'" TextBox3.Text
"',cnIrmpass'" TextBox3.Text "' where mobileno'"TextBox1.Text"'", conn);
cmd.ExecuteNonQuery();
Label.Visible true;
}
}
46
1. HTML CODING OF HOMEPAGE
55
13. QUICK SMS PAGE
56
13.3 QUICK CONTACTS PAGE
57
13.4 SENT MESSAGE PAGE
58
13.5 GMAIL CONNECTIVITY PAGE
59
13.6 PROFILE PAGE
60
13.7 SMSSTORE PAGE
61
15. FUTURE ENHANCEMENTS
Future enhancements oI the website are multimedia messages, International message
sending Iacility and picture messages sending etc. We can add the Ieature like internet calling
to mobiles and other phones Irom diIIerent countries. One oI the important additional Iuture oI
the website like recharging the mobile SIM cards through this website. Scheduler is also yet to
built.
6
16. CONCLUSION
SMS4CHAT initiates the objective oI providing the user with customized and powerIul
tool Ior sending SMS to mobile users. The soItware is built with all options such as adding
contacts, create new groups, and add contacts to that group, storage oI sent sms, Gmail
connectivity and sending E-cards. All the requirements speciIied during the analysis and design
phase are Iully met, thus resulting in the Iormation oI good web application. The interIace
provided is very user Iriendly and Ilexible Ior all times. The main advantage oI this application is
that oIIice as well as personal SMS sending which were tedious processes earlier could now be
done easily without any painstaking eIIorts.
63
17. BIBLIOGRAPHY
O Windows programming Charles Petzoid
O ASP. NET Unleashed Stephen Walther
O Visual Basic .NET Black Book Steven Holzer
O ProIessional ASP. NET Web services Alex Homer, Dave Sussman
O SQL Server Essential ReIerence Sharon Dooley