STRANCHAT
By
Sandeep Kumar RK ( 1215953)
Saurav Dha nothia (1215958)
Aryan Kumar (1215960 )
Under the guidance of
Mr. Sarvanan
Specialization project report submitted in
partial fulfi llment of the requirem ents of V
Semester Bachelor of Computer
Applications, Christ Univ ersity
September - 2014
Department of Computer Science, Christ University
CERTIFICATE
This is to certify that the report titled
StranChat is a bona fi de record of work
done
by
Sandeep
Kumar
(1215953),
Saurav Dhanothia (1215958) and Sunny
Kumar
(1215960)
Bangalore,
in
of
partia l
Christ
University,
fulfi llment
of
the
requir ements of V Semester BCA during the
year 2014.
Head of the Department
Project Guide
Va l u e d - b y:
1.
2.
Name
Re g i s t e r N u m b e r
Exami n ati on Ce n tre
: Christ University
Date of Exam
Department of Computer Science, Christ University
Stranchat
3
I.
ACKNOWLEDGEMENT.
Stranchat would not have been possible without the kind support and help of many
individuals. We would like to extend our sincere thanks to all of them.
We are thankful to Mr.S.Sarvanann for his guidance and constant supervision as well
as for providing necessary information regarding the project and for his support in
completing the project. helped us in the completion of this project.
Our thanks and appreciation also goes to all the people who have willingly helped us
with all their abilities.
Last but not the least, a special and a sincere thanks to the Christ University Lab
administrators and the lab staff for allowing us to use the systems in complete
freedom and supplying us with all the software needed and their technical support.
The project would not have been possible without the contribution, support and
guidance of every individual mentioned above.
Department of Computer Science, Christ University
Stranchat
4
I.
ABSTRACT
The project,title STRANCHAT is a simple,chat application. Our Project is based on
connecting people from various places around the world. As the name suggests, in
random chat people sharing the same field of interest can connect and talk randomly.
To begin with, the person has to sign up providing with the basic information. It helps
in making new friends sharing knowledge clarifying doubts etc. The application
provides various categories through which we can select and interact & communicate
according to their personal choice. The person can connect and disconnect as and
when needed.The aim of building such a website is to help socially challenged people
in interacting to people just on random terms. We do provide the user with 2 options
while using our website.
In the categories section the user is allowed to select from a range of options. He/She
will thus be chatting to some random person on the opposite side with the common
field of interest.
The Random Chat is not based on categories. Its just getting connected to random
people whom we dont know anything about and building a connection to them.
Department of Computer Science, Christ University
Contents
ACKNOWLEDGEMENT.................................................................................. iii
ABSTRACT................................................................................................... iv
LIST OF FIGURES......................................................................................... vi
LIST OF TABLES.......................................................................................... vii
1. INTRODUCTION........................................................................................ 1
1.1 OVERVIEW OF THE SYSTEM................................................................1
2.1 EXISTING SYSTEM...............................................................................2
2.2 PROPOSED SYSTEM............................................................................2
2.3 LITERATURE REVIEW...........................................................................3
2.4 SOFTWARE TOOLS USED....................................................................3
3. SYSTEM REQUIREMENTS.........................................................................4
3.1 SYSTEM MODEL..................................................................................4
3.2 FUNCTIONAL REQUIREMENT...............................................................4
3.3 HARDWARE REQUIREMENTS...............................................................5
3.4 SOFTWARE REQUIREMENTS...............................................................5
4.1 ARCHITECTURAL DESIGN....................................................................6
4.2 FLOWCHART....................................................................................... 7
4.3 DATABASE DESIGN................................................................................. 8
4.3.1 TABLE DESIGN USER TABLE.............................................................8
4.3.2 Data Dictionary............................................................................... 9
4.3.3 DATA FLOW DIAGRAM....................................................................11
4.3.4 ENTITY RELATIONSHIP DIAGRAM...................................................11
4.4 USER INTERFACE DESIGN.................................................................12
5. IMPLIMENTATION....................................................................................14
5.1 SOURCE CODE:................................................................................. 14
5.2 SCREEN SHOTS:...............................................................................35
6. TESTING................................................................................................ 41
6.1 TEST PLAN :...................................................................................... 41
6.2 TEST CASES AND REPORTS..............................................................42
CONCLUSION............................................................................................. 44
7.1 ADVANTAGES.................................................................................... 44
7.2 LIMITATIONS:.................................................................................... 44
7.3 FUTURE ENHANCEMENT...................................................................45
REFERENCES............................................................................................. 46
Department of Computer Science, Christ University
Department of Computer Science, Christ University
Stranchat
6
I.
LIST OF FIGURES
Fig. No.
Figure Name
Page No.
3.1
System Model
4.1
Architectural Design
4.3.3
Data Flow Diagram
10
4.3.4
Entity Relationship Diagram
26
5.2.1
Form 1
27
5.2.2
Friends
28
5.2.3
Feedback
5.2.4
Form 1
5.2.5
Home
5.2.6
Confirm Box
5.2.7
Profile
5.2.8
Form 1
Department of Computer Science, Christ University
Stranchat
7
I.
LIST OF TABLES
Table. No.
3.3
Title
Hardware Requirements
4.3.1
User Table
4.3.2
Feedback Table
4.3.3
IP Table
4.3.2.1
Data Dictionary
4.3.2.3
IP Table
Department of Computer Science, Christ University
Page No.
StranChat
1
1. INTRODUCTION
1.1 OVERVIEW OF THE SYSTEM
Our Project is based on connecting people from various places around the world. As
the name suggests, in random chat people sharing the same field of interest can
connect and talk randomly. To begin with, the person has to sign up providing with
the basic information. It helps in making new friends sharing knowledge clarifying
doubts etc.
The application provides various categories through which we can select and interact
& communicate according to their personal choice. The person can connect and
disconnect as and when needed.
The aim of building such a website is to help socially challenged people in interacting
to people just on random terms. We do provide the user with 2 options while using our
website. 1) Categories 2) Random
In the categories section the user is allowed to select from a range of options. He/She
will thus be chatting to some random person on the opposite side with the common
field of interest.
The Random Chat is not based on categories. Its just getting connected to random
people whom we dont know anything about and building a connection to them.
Department of Computer Science, Christ University
StranChat
2
2. SYSTEM ANALYSIS
2.1 EXISTING SYSTEM
The current system does provide us with the random chat option thus connecting us to
anyone throughout the globe (in other words: A STRANGER).
LIMITATIONS:
The user has no clue of the person he/she is interacting with. There is no such
information given.
It does not have categories.
Not user friendly.
No such future contact can be maintained with the other person.
2.2 PROPOSED SYSTEM
This website stranchat.com is for those who find difficulty in socializing. In this
website we are adding more features such as sending a friend request to the stranger if
you found him/her interesting. We are providing the user with categories through
which he can talk to the opposite person on the common topic of interest.
BENEFITS OF THE PROPOSED SYSTEM:
Categories option does help the user to chat on common topics of interest.
One can keep in touch on the website itself by sending a friend request to the
opposite user.
More of a user friendly website.
Helps the shy and the non-socializing people improve their socializing and
communication skills.
You can have a complete view of the profile of the user whom you are
currently connected to.
Department of Computer Science, Christ University
StranChat
3
2.3 LITERATURE REVIEW
Books:
[1] We used this book to gain a basic understanding of the new language we had to
learn, C#. It also provided a good introduction to the .NET Framework and
programming using Visual Studio.
[2] We learnt how to make a windows application using c# and oracle as our basic
database and how to connect the database with the application.
Websites:
We also used a number of websites for tutorials and error resolution in our
programming endeavours for this project. The following are the major websites we
used:
[1] C# Tutorials taught us the different functions available.
[4] We have used this website for error handling and connecting our application to the
database
2.4 SOFTWARE TOOLS USED
Platform Windows 7 and Windows 8
Front End- Microsoft Visual Studio 2010
Back End- MySQL
Department of Computer Science, Christ University
StranChat
4
3. SYSTEM REQUIREMENTS
3.1 SYSTEM MODEL
Fig 3.1 System Model
3.2 FUNCTIONAL REQUIREMENT
1. Sign up This is for the first time users to register with our website. Full
name, username, password, Gender, Email id and Profile picture
2. Login The user can enter the chat page after he has logged in. Username and
password.
3. Random Chat page New Chat window displaying the sender name and
profile picture.
4. Categories Allows the user to select from the list of categories like sports,
Entertainment, Education, Patriotic, History, etc.
5. Friends list After Random chat the user will have an option to add the person
in his/her friend list and the friends who are online will appear in the list.
6. Feedback The users can add in feedback with respect to the software like
there is an additional requirement, changes and complaints.
Department of Computer Science, Christ University
StranChat
5
3.3 HARDWARE REQUIREMENTS
Processor
Processor: Intel core 2 Duo CPU T6600 @
2.20Ghz 2.20
RAM
RAM:2.00 GB or above
Available Hard Disk Space
1 GB of available space required on system
drive
2 GB of available space required on
installation drive.
Table 3.3 Hardware Requirements
3.4 SOFTWARE REQUIREMENTS
Front end
Microsoft visual studio 2010 c# .net represents a significant development over earlier
versions of the language. A number of major changes have been introduced to the
development environment that represents a quantum shift for developers in the way
that application design, development, deployment is approached.
Back end
MySQL is the worlds most popular open source database, enabling the cost-effective
delivery of reliable, high-performance and scalable Web-based and embedded
database applications.
Department of Computer Science, Christ University
StranChat
6
4. DESIGN SPECIFICATION
4.1 ARCHITECTURAL DESIGN
Fig 4.1 Architectural design
Department of Computer Science, Christ University
StranChat
7
4.2 FLOWCHART
Fig 4.2 Flowchart
Department of Computer Science, Christ University
StranChat
8
Field Name
Data type
Uid
Int
Name
Varchar
Password
Varchar
Gender
Varchar
Birthdate
Date
Pic
Image
Ipath
Varchar
Username
Varchar
e-mail
Varchar
4.3 DATABASE DESIGN
4.3.1 TABLE DESIGN USER TABLE
User Table
Table: 4.3.2 User Table
IP Table
Field Name
Datatype
Name
Varchar
Category
Varchar
Ip
Varchar
Table: 4.3.3 IP Table
Department of Computer Science, Christ University
StranChat
9
4.3.2 DATA DICTIONARY
User Table
Field name
Data type
Description
Uid
Int
It is a primary key of User table
Name
Varchar
Name of the user
Password
Varchar
It is provided to login
Gender
Varchar
To identify the user gender
Birthdate
Date
To know the date of birth of the user
Pic
Image
To update profile picture for the
user
Ipath
varchar
The path of the image
Username
varchar
It is used to login
Email
varchar
to send mail to the user
Table: 4.3.2.1 User Table
Feedback Table
Field name
Data type
Description
Fname
Varchar
The users name who sends feedback
Feid
Varchar
The email id of the user
Feedback
Varchar
The comments passed by the user
Uid
Int
The user id
Table: 4.3.2.2 Feedback Table
IP Table
Department of Computer Science, Christ University
StranChat
10
Field Name
Datatype
Description
Name
Varchar
The current user
Category
Varchar
The subject of the chat
Ip
Varchar
IP address of the current system
Table: 4.3.2.3 IP Table
4.3.3 DATA FLOW DIAGRAM
Department of Computer Science, Christ University
StranChat
11
Fig 4.3.3
4.3.4 ENTITY RELATIONSHIP DIAGRAM
Fig 4.3.4
4.4 USER INTERFACE DESIGN
LOGIN PAGE
Username
Passwor
d
Login
Department of Computer Science, Christ University
StranChat
12
Fig 4.4.1
Profile picture
Full name
Gender
Email-id
Username
Password
Subm
Department of Computer Science, Christ University
StranChat
13
Fig 4.4.2
5. IMPLIMENTATION
5.1 SOURCE CODE:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.Data.Sql;
Department of Computer Science, Christ University
StranChat
14
using System.IO;
namespace stranchatapp
{
public partial class Login : Form
{
SqlConnection con = new SqlConnection("Data Source=LENOVO;Initial
Catalog=stranchatapp;Integrated Security=True");
//int date = 0;
//int s=0;
string g;
//string userid;
public Login()
{
InitializeComponent();
}
private void buttonregister_Click(object sender, EventArgs e)
{
try
{
int t = 0;
Department of Computer Science, Christ University
StranChat
15
foreach (Control c1 in this.groupBox2.Controls)
{
if (c1 is TextBox)
{
if (c1 is TextBox && c1.Text == "")
{
MessageBox.Show("Field cannnot be blank");
c1.BackColor = Color.Red;
c1.Focus();
}
else
t++;
}
}
if (textconfirmpass.Text != textpass.Text)
{
MessageBox.Show("Password does not match");
textconfirmpass.Focus();
t--;
}
if (dateTimePicker1.Text == " ")
{
MessageBox.Show("Field cannnot be blank");
Department of Computer Science, Christ University
StranChat
16
dateTimePicker1.BackColor = Color.Red;
}
else if (dateTimePicker1.Text != " ")
t++;
if (radioButtonmale.Checked == true || radioButtonfemale.Checked == true)
t++;
else
{
MessageBox.Show("Field cannnot be blank");
radioButtonmale.BackColor = Color.Red;
radioButtonfemale.BackColor = Color.Red;
}
if (t == 7)
{
con.Open();
string str = "insert into [user]
(name,gender,birthdate,email,username,password,pic,ipath)
values(@name,@gender,@birthdate,@email,@username,@password,@pic,@ipath)";
SqlCommand cmd = new SqlCommand(str, con);
byte[] bimage = null;
string image = textBoximagepath.Text;
if (image != "")
Department of Computer Science, Christ University
StranChat
17
{
global.image = textBoximagepath.Text;
Bitmap bmp = new Bitmap(image);
FileStream fs = new FileStream(image, FileMode.Open,
FileAccess.Read);
bimage = new byte[fs.Length];
fs.Read(bimage, 0, Convert.ToInt32(fs.Length));
fs.Close();
}
if (image == "")
{
image = pictureBox1.ImageLocation.ToString();
global.image = image;
Bitmap bmp = new Bitmap(image);
FileStream fs = new FileStream(image, FileMode.Open,
FileAccess.Read);
bimage = new byte[fs.Length];
fs.Read(bimage, 0, Convert.ToInt32(fs.Length));
fs.Close();
}
cmd.Parameters.Add("@name", SqlDbType.VarChar).Value =
textname.Text;
cmd.Parameters.Add("@gender", SqlDbType.VarChar).Value = g;
cmd.Parameters.Add("@birthdate", SqlDbType.VarChar).Value =
dateTimePicker1.Text;
Department of Computer Science, Christ University
StranChat
18
cmd.Parameters.Add("@email", SqlDbType.VarChar).Value =
textemail.Text;
cmd.Parameters.Add("@username", SqlDbType.VarChar).Value =
textuser.Text;
cmd.Parameters.Add("@password", SqlDbType.VarChar).Value =
textpass.Text;
cmd.Parameters.Add("@pic", SqlDbType.Image).Value = bimage;
cmd.Parameters.Add("@ipath", SqlDbType.VarChar).Value = image;
cmd.ExecuteNonQuery();
MessageBox.Show("Account successfully created.");
string str1 = ("select uid from [user] where username ='" + textuser.Text +
"'AND password = '" + textpass.Text + "'");
SqlCommand cmd2 = new SqlCommand(str1, con);
global.userid = cmd2.ExecuteScalar().ToString();
this.Hide();
Home h1 = new Home();
h1.ShowDialog();
con.Close();
}
}
catch (Exception)
{
MessageBox.Show("The username already exixts");
Department of Computer Science, Christ University
StranChat
19
textuser.Focus();
}
}
private void buttonsignin_Click(object sender, EventArgs e)
{
//check if username and password matches with the database then open home
page
SqlConnection con = new SqlConnection("Data Source=LENOVO;Initial
Catalog=stranchatapp;Integrated Security=True");
con.Open();
string a = "select * from [user] where username ='" + textusername.Text +
"'AND password = '" + textpassword.Text + "'";
SqlCommand cmd = new SqlCommand(a, con);
SqlDataReader sdr = cmd.ExecuteReader();
if (sdr.Read() == true)
{
//username password correct
MessageBox.Show("Login Successfull");
con.Close();
con.Open();
string str1=("select uid from [user] where username ='" + textusername.Text
+ "'AND password = '" + textpassword.Text + "'");
SqlCommand cmd1 = new SqlCommand(str1, con);
string str2 = ("select ipath from [user] where username ='" +
textusername.Text + "'AND password = '" + textpassword.Text + "'");
Department of Computer Science, Christ University
StranChat
20
SqlCommand cmd2 = new SqlCommand(str2, con);
global.image = cmd2.ExecuteScalar().ToString();
global.userid = cmd1.ExecuteScalar().ToString();
this.Hide();
Home h = new Home();
h.ShowDialog();
con.Close();
}
else
MessageBox.Show("username or password is incorrect");
private void buttonregisterform_Click(object sender, EventArgs e)
{
groupBox2.Show();
textname.Focus();
buttonregisterform.Hide();
}
private void dateTimePicker1_ValueChanged(object sender, EventArgs e)
{
//date = 1;
Department of Computer Science, Christ University
StranChat
21
//t++;
}
private void radioButtonmale_CheckedChanged(object sender, EventArgs e)
{
g="Male";
}
private void radioButtonfemale_CheckedChanged(object sender, EventArgs e)
{
g="Female";
}
private void buttonbrowseimage_Click(object sender, EventArgs e)
{
image images = new image();
OpenFileDialog openFileDialog1 = new OpenFileDialog();
openFileDialog1.ShowDialog();
//openFileDialog1.Filter = "JPEG Files (*.jpeg)|*.jpeg|PNG Files(*.png)|
*.png|JPG";
openFileDialog1.Filter = "Image Files(*.jpeg;*.bmp;*.png;*.jpg)|
*.jpeg;*.bmp;*.png;*.jpg";
openFileDialog1.DefaultExt = ".jpeg";
textBoximagepath.Text = openFileDialog1.FileName;
pictureBox1.ImageLocation = textBoximagepath.Text;
pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
}
Department of Computer Science, Christ University
StranChat
22
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.Net;
using System.Net.Sockets;
namespace stranchatapp
{
public partial class chat1 : Form
{
Socket sck;
EndPoint eplocal, epRemote;
Department of Computer Science, Christ University
StranChat
23
public chat1()
{
InitializeComponent();
sck = new Socket(AddressFamily.InterNetwork, SocketType.Dgram,
ProtocolType.Udp);
sck.SetSocketOption(SocketOptionLevel.Socket,
SocketOptionName.ReuseAddress, true);
textlocalip.Text = GetLocalIP();
textfriendsip.Text = GetLocalIP();
}
private string GetLocalIP()
{
IPHostEntry host;
host = Dns.GetHostEntry(Dns.GetHostName());
foreach (IPAddress ip in host.AddressList)
{
if (ip.AddressFamily == AddressFamily.InterNetwork)
{
return ip.ToString();
}
Department of Computer Science, Christ University
StranChat
24
}
return "127.0.0.1";
}
private void MessageCallBack(IAsyncResult aResult)
{
try
{
int size = sck.EndReceiveFrom(aResult, ref epRemote);
if (size > 0)
{
byte[] receivedData = new byte[1464];
receivedData = (byte[])aResult.AsyncState;
ASCIIEncoding eEncoding = new ASCIIEncoding();
string receivedMessage = eEncoding.GetString(receivedData);
listMessage.Items.Add("Friend:" + receivedMessage);
}
byte[] buffer = new byte[1500];
sck.BeginReceiveFrom(buffer, 0, buffer.Length, SocketFlags.None, ref
epRemote, new AsyncCallback(MessageCallBack), buffer);
}
catch (Exception exp)
Department of Computer Science, Christ University
StranChat
25
{
MessageBox.Show(exp.ToString());
}
}
private void textBox2_TextChanged(object sender, EventArgs e)
{
private void Start_Click(object sender, EventArgs e)
{
try
{
eplocal = new IPEndPoint(IPAddress.Parse(textlocalip.Text),
Convert.ToInt32(textlocalport.Text));
sck.Bind(eplocal);
epRemote = new IPEndPoint(IPAddress.Parse(textfriendsip.Text),
Convert.ToInt32(textfriendsport.Text));
sck.Connect(epRemote);
byte[] buffer = new byte[1500];
sck.BeginReceiveFrom(buffer, 0, buffer.Length, SocketFlags.None, ref
epRemote, new AsyncCallback(MessageCallBack), buffer);
Department of Computer Science, Christ University
StranChat
26
Start.Text = "Connected";
Start.Enabled = false;
Send.Enabled = true;
textmessage.Focus();
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
private void Send_Click(object sender, EventArgs e)
{
try
{
System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding();
byte[] msg = new byte[1500];
msg = enc.GetBytes(textmessage.Text);
sck.Send(msg);
listMessage.Items.Add("YOU:"+textmessage.Text);
textmessage.Clear();
Department of Computer Science, Christ University
StranChat
27
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
private void listMessage_SelectedIndexChanged(object sender, EventArgs e)
{
private void chat1_Load(object sender, EventArgs e)
{
label1.Text = global.categories;
}
//private void buttonhome_Click(object sender, EventArgs e)
//{
//
this.Hide();
//
Home h = new Home();
//
h.ShowDialog();
//}
Department of Computer Science, Christ University
StranChat
28
private void pictureBox1_Click(object sender, EventArgs e)
{
this.Hide();
Home h = new Home();
h.ShowDialog();
}
private void pictureBox1_MouseMove(object sender, MouseEventArgs e)
{
//pictureBox1.Tag = "Home";
//MessageBox.Show("HOME");
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
Department of Computer Science, Christ University
StranChat
29
using System.Windows.Forms;
using System.Data.SqlClient;
using System.Data;
using System.IO;
namespace stranchatapp
{
public partial class profile : Form
{
public profile()
{
InitializeComponent();
}
private void profile_Load(object sender, EventArgs e)
{
private void buttoneditprofile_Click(object sender, EventArgs e)
{
groupBoxprofile.Show();
pictureBoxedit.ImageLocation = global.image;
Department of Computer Science, Christ University
StranChat
30
SqlConnection con = new SqlConnection("Data Source=LENOVO;Initial
Catalog=stranchatapp;Integrated Security=True");
con.Open();
string sql = "select * from [user] where uid=" + global.userid;
SqlCommand cmd = new SqlCommand(sql, con);
SqlDataReader sdr = cmd.ExecuteReader();
if (sdr.Read() == true)
{
textname.Text = sdr["name"].ToString();
dateTimePicker1.Text = sdr["birthdate"].ToString();
textemail.Text = sdr["email"].ToString();
textuser.Text = sdr["username"].ToString();
textpass.Text = sdr["password"].ToString();
string g = sdr["gender"].ToString();
string m = radioButtonmale.Text;
string f = radioButtonfemale.Text;
f.Replace("\n", string.Empty);
m.Replace("\n", string.Empty);
//MessageBox.Show(g+"hi");
//MessageBox.Show(b+"hi");
if (g.Equals(m))
radioButtonmale.Checked = true;
else
radioButtonfemale.Checked = true;
Department of Computer Science, Christ University
StranChat
31
con.Close();
}
private void buttonedit_Click(object sender, EventArgs e)
{
if (textpass.Text != textconfirmpass.Text)
MessageBox.Show("Please confirm the password correctly");
else
{
SqlConnection con = new SqlConnection("Data Source=LENOVO;Initial
Catalog=stranchatapp;Integrated Security=True");
con.Open();
string
sql
"update
[user]
set
name=@name,gender=@gender,birthdate=@birthdate,email=@email,username=@us
ername,password=@password,pic=@pic,ipath=@ipath where uid=" + global.userid;
SqlCommand cmd = new SqlCommand(sql, con);
cmd.Parameters.Add("@name", SqlDbType.VarChar).Value =
textname.Text;
cmd.Parameters.Add("@birthdate", SqlDbType.VarChar).Value =
dateTimePicker1.Text;
cmd.Parameters.Add("@email", SqlDbType.VarChar).Value =
textemail.Text;
Department of Computer Science, Christ University
StranChat
32
cmd.Parameters.Add("@username", SqlDbType.VarChar).Value =
textuser.Text;
cmd.Parameters.Add("@password", SqlDbType.VarChar).Value =
textpass.Text;
if (radioButtonmale.Checked)
{
cmd.Parameters.Add("@gender", SqlDbType.VarChar).Value =
radioButtonmale.Text;
}
else
{
cmd.Parameters.Add("@gender", SqlDbType.VarChar).Value =
radioButtonfemale.Text;
}
byte[] bimage = null;
string image = labelimagelocation.Text;
if (image != "")
{
global.image = labelimagelocation.Text;
Bitmap bmp = new Bitmap(image);
FileStream fs = new FileStream(image, FileMode.Open,
FileAccess.Read);
bimage = new byte[fs.Length];
fs.Read(bimage, 0, Convert.ToInt32(fs.Length));
fs.Close();
Department of Computer Science, Christ University
StranChat
33
cmd.Parameters.Add("@pic", SqlDbType.Image).Value = bimage;
cmd.Parameters.Add("@ipath", SqlDbType.VarChar).Value = image;
}
if (image == "")
{
image = pictureBoxedit.ImageLocation.ToString();
global.image = image;
Bitmap bmp = new Bitmap(image);
FileStream fs = new FileStream(image, FileMode.Open,
FileAccess.Read);
bimage = new byte[fs.Length];
fs.Read(bimage, 0, Convert.ToInt32(fs.Length));
fs.Close();
}
cmd.ExecuteNonQuery();
con.Close();
MessageBox.Show("Profile Successfully updated");
this.Hide();
Home h = new Home();
h.ShowDialog();
}
}
private void buttonbrowseimage_Click(object sender, EventArgs e)
Department of Computer Science, Christ University
StranChat
34
{
image images = new image();
OpenFileDialog openFileDialog1 = new OpenFileDialog();
openFileDialog1.ShowDialog();
//openFileDialog1.Filter = "JPEG Files (*.jpeg)|*.jpeg|PNG Files(*.png)|
*.png|JPG";
openFileDialog1.Filter = "Image Files(*.jpeg;*.bmp;*.png;*.jpg)|
*.jpeg;*.bmp;*.png;*.jpg";
openFileDialog1.DefaultExt = ".jpeg";
labelimagelocation.Text = openFileDialog1.FileName;
pictureBoxedit.ImageLocation = labelimagelocation.Text;
}
private void pictureBox1_Click(object sender, EventArgs e)
{
this.Hide();
Home h = new Home();
h.ShowDialog();
}
}
}
Department of Computer Science, Christ University
StranChat
35
5.2 SCREEN SHOTS:
Fig 5.2.1
Department of Computer Science, Christ University
StranChat
36
Fig 5.2.2
Department of Computer Science, Christ University
StranChat
37
Fig 5.2.3
Fig 5.2.4
Department of Computer Science, Christ University
StranChat
38
Fig 5.2.5
Department of Computer Science, Christ University
StranChat
39
Fig 5.2.6
Fig 5.2.7
Department of Computer Science, Christ University
StranChat
40
Fig 5.2.8
Department of Computer Science, Christ University
StranChat
41
6. TESTING
6.1 TEST PLAN :
A test strategy is an outline that describes the testing approach of the software development
cycle. This includes the testing objective, methods of testing new functions, total time and
resources required for the project, and the testing environment.
Test strategies describe how the product risks of the stakeholders are mitigated at the
test-level, which types of test are to be performed, and which entry and exit criteria
apply. They are created based on development design documents. System design
documents are primarily used and occasionally, conceptual design documents may be
referred to. Design documents describe the functionality of the software to be enabled
in the upcoming release. For every stage of development design, a corresponding test
strategy should be created to test the new feature sets. There are two methods used in
executing test cases: manual and automated. Depending on the nature of the testing, it
is usually the case that a combination of manual and automated testing is the best
testing method.
Types of testing:
White box testing: This strategy deals with the internal logic and structure of the code.
White box testing is also called as glass, structural, open box or clear box testing. The
tests written based on the white box testing strategy incorporate coverage of the code
written, branches, paths, statements and internal logic of the code etc. In order to
implement white box testing, the tester has to deal with the code and hence is needed
to possess knowledge of coding and logic i.e. internal working of the code. White
box test also needs the tester to look into the code and find out which
unit/statement/chunk of the code is malfunctioning.
Black Box Testing: This is not a type of testing; it instead is a testing strategy, which
does not need any knowledge of internal design or code etc. As the name "black box"
suggests, no knowledge of internal logic or code structure is required. The types of
testing under this strategy are totally based/focused on the testing for requirements
and functionality of the work product/software application. Black box testing is
sometimes also called as "Opaque Testing",
Department of Computer Science, Christ University
StranChat
42
6.2 TEST CASES AND REPORTS
Table 6.1 Test Cases
Test case id
Screen Name
Description
TEST VALUES
Expected
Output
1.
Login
Login page is the first
page of the application .
the user logs in to the
system through this
Correct input:
Username:
Loads the log
sandeep
page
page before making any
Password: 123
changes in the data in
Incorrect input:
the application
Username: san
Password: yzx
2.
Register
The user Registers to be
a member of the
Stranchat, by giving us
the relevant information
Invalid User
password
Correct input:
All details are
Successfully
given
registered
Incorrect
input:
Few details left
Error in
registration
blank
3.
Profile
This screen displays all
the details of the present
user who has logged in
Correct Input:
Mention all the
Details
details and check
successfully
confirm
updated
password
Incorrect input:
Department of Computer Science, Christ University
Enter the
StranChat
43
Leave details
password
empty. Password
correctly
does not match
4.
Chat
This page is used to chat Correct input:
between two different
users, by connecting
them through their IP
address.
Correct IP
Successfully
address
Connected
Incorrect input:
Mismatch of IP
Connection
address
Failed
CONCLUSION
Stranchat was really something that made us learn quite a lot. Not just about the
coding part that helped us improve our knowledge in coding languages but we also
learnt the most important aspect of all: TEAMWORK.
7.1 ADVANTAGES
STRANCHAT, an aid to the people by the people.
Department of Computer Science, Christ University
StranChat
44
1. Here, you need not be thinking much before communicating with others. All
you need is a connection that in our case is done with the help of a LAN wire.
2. In the 21st century, it would be impossible to stay without communicating. We,
the students of BCA 5th Semester break this wall.
3. An easy to use application for the user. The application is very much easy to
use and the user need not be highly educated to use this app. Developed for the
common.
4. The interface is user friendly and the forms are too basic and interestingly
have a good catchy design.
7.2 LIMITATIONS:
1. This project uses sockets. Sockets are used for immediate conversations. It
will be difficult for the user actually to get the messages on the screen without
refreshing the page.
2. The application is small just focused on the chat factor. We havent kept up to
the mark of putting it up on the internet.
3. The tables and the random thing that was actually the main part will be
continued in our next part that is the 6th semester if given a chance.
7.3 FUTURE ENHANCEMENT
1. Implying Html, CSS, Ajax, Sockets we can make this project a web
application that will be available on the website in the future.
2. The normal chat can thus be used to make talks to random people on the
website.
3. The security can be improved thus making the user feel secure and relaxed
that his information lies in safe hands.
Department of Computer Science, Christ University
StranChat
45
REFERENCES
Book:
[1] Balagurusamy, E. Programming in C#. A Primer 3rd Edition. Tata McGraw-Hill
Education, 2010.
[2] Mayo, Joe. Microsoft Visual Studio 2010. A Beginner's Guide 1st Edition. Tata
McGraw-Hill Education, 2010.
Website:
[1] Visual C#.NET Visual C# .NET Programming
Department of Computer Science, Christ University
StranChat
46
http://www.homeandlearn.co.uk/csharp/csharp.html
[2]www.w3schools.com/webservices
[3]www.visualcsharptutorials.com
[4]www.stackoverflow.com
Department of Computer Science, Christ University