Stranchat: Department of Computer Science, Christ University
Stranchat: Department of Computer Science, Christ University
Stranchat: Department of Computer Science, Christ University
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
CERTIFICATE
by
Sandeep
Kumar
(1215953),
(1215960)
Bangalore,
in
of
partia l
Christ
University,
fulfi llment
of
the
2.
Name
Re g i s t e r N u m b e r
: Christ University
Date of Exam
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.
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.
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
Stranchat
6
I.
LIST OF FIGURES
Fig. No.
Figure Name
Page No.
3.1
System Model
4.1
Architectural Design
4.3.3
10
4.3.4
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
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
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.
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.
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.
StranChat
3
StranChat
4
3. SYSTEM REQUIREMENTS
3.1 SYSTEM MODEL
StranChat
5
Processor
RAM
RAM:2.00 GB or above
StranChat
6
4. DESIGN SPECIFICATION
4.1 ARCHITECTURAL DESIGN
StranChat
7
4.2 FLOWCHART
StranChat
8
Field Name
Data type
Uid
Int
Name
Varchar
Password
Varchar
Gender
Varchar
Birthdate
Date
Pic
Image
Ipath
Varchar
Username
Varchar
Varchar
IP Table
Field Name
Datatype
Name
Varchar
Category
Varchar
Ip
Varchar
Table: 4.3.3 IP Table
StranChat
9
Data type
Description
Uid
Int
Name
Varchar
Password
Varchar
It is provided to login
Gender
Varchar
Birthdate
Date
Pic
Image
Ipath
varchar
Username
varchar
It is used to login
varchar
Feedback Table
Field name
Data type
Description
Fname
Varchar
Feid
Varchar
Feedback
Varchar
Uid
Int
The user id
IP Table
Department of Computer Science, Christ University
StranChat
10
Field Name
Datatype
Description
Name
Varchar
Category
Varchar
Ip
Varchar
StranChat
11
Fig 4.3.3
4.3.4 ENTITY RELATIONSHIP DIAGRAM
Fig 4.3.4
LOGIN PAGE
Username
Passwor
d
Login
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
{
int t = 0;
Department of Computer Science, Christ University
StranChat
15
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");
StranChat
16
dateTimePicker1.BackColor = Color.Red;
}
else if (dateTimePicker1.Text != " ")
t++;
if (t == 7)
{
con.Open();
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;
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;
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");
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
StranChat
21
//t++;
}
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;
StranChat
23
public chat1()
{
InitializeComponent();
textlocalip.Text = GetLocalIP();
textfriendsip.Text = GetLocalIP();
}
private string GetLocalIP()
{
IPHostEntry host;
host = Dns.GetHostEntry(Dns.GetHostName());
StranChat
24
}
return "127.0.0.1";
}
}
byte[] buffer = new byte[1500];
sck.BeginReceiveFrom(buffer, 0, buffer.Length, SocketFlags.None, ref
epRemote, new AsyncCallback(MessageCallBack), buffer);
}
catch (Exception exp)
StranChat
25
{
MessageBox.Show(exp.ToString());
}
}
StranChat
26
Start.Text = "Connected";
Start.Enabled = false;
Send.Enabled = true;
textmessage.Focus();
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
StranChat
27
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
this.Hide();
//
//
h.ShowDialog();
//}
StranChat
28
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;
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();
}
StranChat
30
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();
}
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
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;
}
StranChat
35
Fig 5.2.1
StranChat
36
Fig 5.2.2
StranChat
37
Fig 5.2.3
Fig 5.2.4
StranChat
38
Fig 5.2.5
StranChat
39
Fig 5.2.6
Fig 5.2.7
StranChat
40
Fig 5.2.8
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",
StranChat
42
Test case id
Screen Name
Description
TEST VALUES
Expected
Output
1.
Login
Correct input:
Username:
sandeep
page
Password: 123
Incorrect input:
the application
Username: san
Password: yzx
2.
Register
Invalid User
password
Correct input:
All details are
Successfully
given
registered
Incorrect
input:
Few details left
Error in
registration
blank
3.
Profile
Correct Input:
Mention all the
Details
successfully
confirm
updated
password
Incorrect input:
Enter the
StranChat
43
Leave details
password
empty. Password
correctly
Chat
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
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.
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