You are on page 1of 53

.

NET INTRODUCTION
.NET Framework (pronounced dot net) is a software
framework developed by Microsoft that runs
primarily on Microsoft Windows. It includes a large
class library known as Framework Class Library
(FCL) and provides language interoperability (each
language can use code written in other languages)
across several programming languages. Programs
written for .NET Framework execute in a software
environment (as contrasted to hardware
environment), known as Common Language
Runtime (CLR), an application virtual machine that
provides services such as security, memory
management, and exception handling. FCL and CLR
together constitute .NET Framework. FCL provides
user interface, data access, database connectivity,
cryptography, web application development,
numeric algorithms, and network communications.
Programmers produce software by combining their
own source code with .NET Framework and other
libraries.
1

.NET Framework is intended to be used by most


new applications created for Windows platform.
Microsoft also produces an integrated development
environment largely for .NET software called Visual
Studio.

ARCHITECTURE

Common Language Infrastructure (CLI) The


purpose of CLI is to provide a language neutral
platform for application development and
execution, including functions for exception
handling, garbage collection, security, and
interoperability. By
implementing the core aspects of .NET
Framework within the scope of CLI, this
functionality will not be tied to a single
language but will be available across the many
languages supported by the framework.
3

Microsoft's implementation of CLI is CLR.


Common Intermediate Language (CIL) code is
housed in CLI assemblies. As mandated by the
specification, assemblies are stored in Portable
Executable (PE) format, common on Windows
platform for all DLL and EXE files. The
assembly consists of one or more files, one of
which must contain the manifest, which has the
metadata for the assembly.
OBJECTIVE OF THE PROJECT
To develop an application project to manage the
workings of a Cyber Caf.
INTRODUCTION
Cyber Caf Management is a complete package
developed for management of systems in a
cyber caf. This project is intended to be used in
a Cyber Caf. All cyber cafes have some basic
needs likeable to control the systems that are
being rented to the customers and are charged
on timely basis.
4

A Cyber caf normally has some number of


PCs which the customers will for certain
amount of time. Now days it may also require
to save some details of the customers for
security reasons. When a customer enters a
cyber caf he has to be allotted a PC and the
start time is noted. At any time the cyber
administrator should be able to see the status of
any PC , When the customer wants to do some
other activities like taking a print out or scan a
copy etc. It should be recorded. And finally all
the details will be available to the Cyber
administrator. And he can submit on the form to
generate the bill. There should be displays of all
the transactions taking place in the caf.
LANGUAGE TO BE USED:
VB.Net and Visual Basic 2005 as Frontend.
Microsoft SQL Server 2005 as Backend.

STRUCTURE OF A PROGRAM
Cyber cafe management
This project basically contains two types of
users: the server user and the client user.
The Server user is the administrator of the
Server machine who has the right to monitor
each and every client or customer. He will
have the rights to remotely login or logout
the client user. He solely controls the Server
machine.
The Client user is the customer for the
cyber. He can login to the client system and
start browsing only if he is authenticated
(by username and password)otherwise the
Admin user can log him in remotely.
There can be multiple clients interacting with
the server, sending multiple requests at the same
time.
6

Analysis:
Modern world is computer world where the
things have to be done promptly that requires
optimal resources and optimal methods. Due to
this inevitable requirement, computerization of
each and every sector in the main stream is
must. So that it can be held itself in the race.
In this context, our software replaces all the
manual effort and the paper works done by the
owner of the cyber to a completely
electronically environment, be it bill generation
or customer creation and fulfillment of their
needs and customer satisfaction. Hence both the
customer and the owner are at their ease.

Module Description:
1. Server Module:
1.1 Connection Module
This module is supposed to open a socket
connection and keep the socket in wait mode
until it receives some request from the client
side. Once there is some request coming in from
the client, it should receive the data and perform
appropriate functions.
1.2 User Creation and Management
This module should implement the user creation
and management. The users could be given a
username and password and also they could be
given a prepaid account by which they can
browse until they finish the amount in their
accounts.

This module comprises five sub


modules:
Add records: This module deals with adding
or storing the customer details which
includes his/her user name, password, time
plan etc,.
Get customer log information: This module
deals with retrieving the details about the
current customer after his each or after he
completes his session.
Display all records: This module allows the
admin to view or keep track of all the
customer details either on basis of type of
user, or on basis of weekly or monthly.
Time plan: The customer here are offered
two choices to make for the time plan that is
Prepaid and Postpaid. The browsing charge
for prepaid users will be deducted from

his/her account while the postpaid users will


hava to make the entire payment by cash in
accordance to his browsing time.
Active users: This module gives the
information about the logged in users and
the comp that they are logged into.
1.3 Billing
This module should produce bills depending
upon the user activity and hence generate a
report comprising all the requisites, regarding
the customers session. Here the postpaid
customer makes full payment, comprising
charges for his browsing time as well as other
services seeked such as items purchased,
refreshments, scanning, printing etc,. While the
prepaid customer will pay for the extra services
seeked other than browsing time as the due
deduction for browsing will be done through his
account.
10

2. Client Module:
2.1 Client Connection
This module will try to establish connection
with the server. If the connection is successful
then he will be able to use the client system.
The connection request is made on the server
that is available on the network, If the server is
not running or if he is not authenticated then he
will not be able to use the client system.
2.2 Client Requests
This module will allow the customer of the
cyber caf to make requests for some of the
items that are predefined and will be displayed
on his screen. These requests will be shown up
server screen and the admin provides the
11

customer with the requested services to his


place.

Future scope of the project:


The aim of our project is to replace the
paper works & works done manually and to
automate the existing trend in the cyber caf.
Be it user creation, their management or bill
generation, everything is computerized.
Since the admin job is done effortlessly and
at the same time the customer can enjoy his
browsing time entirely, hence both the user
and the owner are at their ease.
We have limited the server and the client
into a single system. For real-time purposes
we can extend the software by installing the
server components into a single system
12

and have multiple clients by installing the


client components into many systems. Here
multiple clients can interact with the single
server at the sometime sending in multiple
requests simultaneously.

Nowadays Cyber Crime has increased


immensely. So in order to avoid the risk of
getting indulged in any scandals regarding
cyber crime we can implement the FINGER
PRINTING Mechanisms in the cyber for the
authentication of the clients or customers of
the cyber.
The acceptance of CREDIT and DEBIT
CARDS for the payments can make the
software more versatile. Allowing the point
of sale concept at the cyber caf can be
another attractive feature of the software.

13

SNAPSHOT OF THE VISUAL BASIC.NET

14

SOFTWARE REQUIREMENT
SPECIFICATION
1. Introduction
A Cyber caf normally has some number of
PCs which the customers will for certain
amount of time. Now days it may also require
to save some details of the customers for
security reasons. When a customer enters a
cyber caf he has to be allotted a PC and the
start time is noted. At any time the cyber
administrator should be able to see the status of
any PC, when the customer wants to do some
other activities like take a print out or scan a
copy etc. It should be recorded. And finally all
the details will be available to the Cyber
administrator. And he can submit on the form to
generate the bill. There should be displays of all
the transactions taking place in the caf.
15

1.1 Purpose
Cyber Caf Management is a complete package
developed for management of systems in a
cyber caf. It is not a part of any other
application. This document will give the entire
requirements and features of the project.
1.2 Project Scope
This project is intended to be used in a Cyber
Caf. All cyber cafes have some basic needs
likeable to control the systems that are being
rented to the customers and are charged on
timely basis. This project has a server part
which runs on the Admin system. And the
Client part which runs on all other systems
which are to be rented. The Admin should have
control over the usage of the client system.

16

1.3 Definitions, Acronyms, Abbreviations


.Net Framework: The programming model of
the .Net Environment for building, deploying
and running web-based applications, smart
client applications and XML web services. It
includes CLR (Common Language Runtime),
CLS (Common Language Specification) and
library of classes.
Winsock: A component supported by VB.Net
that creates a socket based connection between
the systems.
Sockets: These are point of
communicationsbetween two processes that
uses TCP/IP based protocols which provide
connection oriented network services.
ADO.Net: ActiveX Data Object.Net is a feature
supported by .Net Framework
17

which is a connectionless, collection of object


Used to make connections with the database,
hence retrieve, modify, insert, delete &

Manipulate the databases. Use of this object


decreases network traffic.
Dataset: It is an In memory data cache that
stores an entire virtual copy of the database in
RAM during connectionless networks.
Data reader: Used to store data for fast,
forward only and read only verification.
Crystal Reports: A reporting tool with the
ability to create interactive, presentation-quality
reports very easily & quickly.
Data Adapter: It acts as intermediate between
the database and the frontend application.

18

1.5 Overview:
Cyber Caf Management is a complete package
developed for management of systems in a
cyber caf. This project is intended to be used in
a Cyber Caf. All cyber cafes have some basic
needs likeable to control the systems that are
being rented to the customers and are charged
on timely basis.
1.6 Product Perspective:
Cyber caf management is a new self contained
product and is not a part of any other software.
This product should be able to satisfy some of
the basic needs of a cyber caf.

19

1.7

Product Functions

Functions of the Server:


Create / Manage Users
Receive Connection requests from Clients
Receive a predefined set of requests from
the Client
Billing.
Functions of the Client:
Connection with the Server
Request for items available for the client.

20

1.8 User Classes and Characteristics


This project basically contains two types of
users: the server user and the client user.
The Server user is the administrator of the
Server machine. He will have the rights to
remotely login or logout the client user.
The Client user can login to the client system
and start browsing if he knows his username
and password otherwise the Admin user can log
him in remotely.
1.9 General Constraints
This project will ideally run on Windows Xp
Operating system, and it should be able to run
on most other windows operating systems
without any problem as it runs on .Net
Framework which is Independent of all
Windows Operating Systems.
.Net Framework is required to be setup before
installing the
21

Product, Also SQL SERVER 2005 database


server should be setup on the system for the
working of this product.
1.10 Assumptions and Dependencies
This project runs on Windows Xp operating
system. It is assumed that the cyber caf should
have all the systems connected on a LAN
network, and the Admin has a separate system
from which he will be able to control all other
systems.
2.
2.1

Specific Requirements
External Interface Requirements

2.1.1 User Interface Requirements


The user interface is designed using the
windows components of the Visual Studio .Net.
Some of the components are: Windows Forms,
Textboxes, Labels, Frames, Images, and List
View etc.
22

The SQL SERVER connections are made


through ADO.NET feature of the .Net
Framework.
The Network connections are made using
Winsock component of the Visual Studio.
2.1.2 Hardware Interfaces
There is no external hardware required for
running this project.
2.1.3 Software Interfaces
This project runs on .Net framework therefore
this framework should be installed before the
product could be installed.
SQL SERVER 2005 is required for the backend
operations.
This software should be installed separately.
Visual Basic 6.0 is mandatory to be installed in
the system.

23

2.1.4 Communications Interfaces


Communications between the server and the
client component is made through the Winsock
component. Winsock creates a socket based
connection between the systems. Sockets uses
TCP/IP based protocols which provide
connection oriented network services.
2.2

Functional Requirements

2.2.1 Server Module


2.2.1.1 Connection module.
This module is supposed to open a socket
connection and keep the socket in wait mode.
Until it receives some request from the client
side once there is some request coming in from
the client side this should receive the data and
perform appropriate functions.

24

2.2.1.2 User Creation and Management


This module should implement the user creation
and management. The users could be given a
username and password and also they could be
given a prepaid account by which they can
browse until they finish the amount in their
accounts.
2.2.1.3 Billing
This module should produce bills depending
upon the user activity, Like browsing time, and
any other items taken like CDs, Snacks etc.
2.2.2 Client Module
2.2.2.1 Client Connection
This module will try to establish connection
with the server. If the connection is successful
then he will be able to use the client system.
The connection request is made on the server
that is available on the network, If the server is
not running or if he is not authenticated then he
will not be able to use the client system.
25

2.2.2.2 Client Requests


This module will allow the customer of the
cyber caf to make requests for some of the
items that are predefined and will be displayed
on his screen. These requests will show up on
server screen and the admin and provide his
with the requested item.
2.3 Performance Requirements
This System can run on an average
configuration System. The performance
requirements are not very high. The
performance could be affected if there are
network related problems and due to low
memory.
2.4 Design Constraints
This project is developed on .Net Framework;
All the features in the design of the project
should be compliant with this framework. The
SQL used should be specific to the SQL
SERVER 2005 database.
26

2.5 Attributes
This project is developed on a Windows Xp
machine running on Pentium IV processor with
512 MB of memory. The systems on which the
product is to be installed are supposed to have
similar attributes. All the required softwares
should be supported by the systems hardware.
CYBER CAFE Detailed Design
Introduction
Detailed design, which is also known as logic
design, involves the internal sign of the module
and how the specification of the module can be
satisfied. Detailed design is an extension of
system design. The first step before the detailed
design or code for a module can be developed is
that the specification of the module be given
precisely. Once the module is precisely
specified, the external logic for the module that
will implement the given identification can be
decided.
27

The basic logic in detailed design is to specify


the logic for the different modules that been
specified during system design. Specifying the
logic will require developing an algorithm that
will implement the given specifications. This
phase includes the specification of table
structures, which makes us understand the
internal logic of the system. The tables are
described with their field names, data type,
table constraints, description of each field etc.
Applicable Documents
The documents that are applicable for the detail
design are system design document and the
database document.
Structure of the software package
Client: The client here is any registered
customer.

28

Username & Password: Takes the username &


password from the client. Only the
authenticated clients will be able to use the
client systems.
Modular decomposition of components
Modules of components:
Identification of modules
1. Server Connection: This feature opens a
socket connection & enters wait mode
unless it receives any requests coming from
the client side.
2. User Creation & Management: This
feature implements creation of different
kinds of users & their management.
3. Add records: This feature deals with
adding or storing the customer details which
includes his/her username, password, time
plan etc,.
4. Get customer log information: This
feature deals with retrieving the details
29

about the current customer after each


session.
5. Display all records: This feature allows
admin to keep track of all the customer &
his/her details either on daily, monthly,
yearly basis.
6. Time plan: This feature allows the client
to make a choice from the time plan offered
i.e. either prepaid or postpaid.
7. Active users: This feature displays all the
logged in client & the computers to which
they are logged into.
8. Client connection: This feature
establishes a connection between server &
the client.
9. Client request: This feature enables the
client to make request for the services
provided by the cyber.

30

HIERARCHICAL STRUCTURE OF
MODULE:

31

First level factoring:

Factoring of admin module:

32

Factoring of admin module


v.p=valid password
r.u=request for user creation
r.b=request for billing
d.r=display records
g.t=get timeplan
a.u=active users
g.l=get customer log information
a.r=add records
r=retrieve bill details
c.b=calculate bill
g.b=generate bill

33

Factoring of client module:

Factoring of client module


r.pr=request for Prepaid
r.po=request for Postpaid
c=choose package
r.c=register client
r.li=request for login
r.lo=request for logout b=browse
r=request for services
34

SOURCE CODE
Imports System.Data.SqlClient
Module GLobalVariables
Public constr As String = "Data Source =.;Initial
Catlog=cyber;Integrated Security=True"
End Module
Public Class Myconnection
Dim da As SqlDataAdapter
Dim cb As SqlCommandBuilder
Dim ds As Dataset
Public Function getdata(ByVal command As String, ByVal
tablename As String) As Dataset
da = New SqlDataadapter(command, constr)
cb = New SqlCommandBuilder(da)
ds = New Dataset
da.Fill(ds, tablename)
Return ds
End Function
Public Sub updatead()
Try
da.update(ds.Tables(0))
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
35

End Class
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGe
nerated()> _
Partial Class SplashScreen1
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As
Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
Friend WithEvents ApplicationTitle As
System.Windows.Forms.Label
Friend WithEvents Version As
System.Windows.Forms.Label
Friend WithEvents Copyright As
System.Windows.Forms.Label
Friend WithEvents MainLayoutPanel As
System.Windows.Forms.TableLayoutPanel
Friend WithEvents DetailsLayoutPanel As
System.Windows.Forms.TableLayoutPanel
'Required by the window form Designer
Private components As
System.ComponentModel.IContainer
36

'NOTE:the following procedure is required by the window


form designer
'it can be modified using the window form designer
'do not modify it using the code editor.

<System.Diagnostics.DebuggerStepThrough()> _
Private Sub Initializecomponent()
Dim resorces As
System.ComponentModel.ComponentResourceManager = _
New
System.ComponentModel.ComponentResourceManager(GetT
ype(splashscreen1))
Me.MainLayoutPanel = New
System.Windows.Forms.TableLayoutPanel
Me.DetailsLayoutPanel = New
System.Windows.Forms.TableLayoutPanel
Me.Version = New System.Windows.Forms.Label
Me.Copyright = New System.Windows.Forms.Label
Me.ApplicationTitle = New
System.Windows.Forms.Label
Me.MainLayoutPanel.SuspendLayout()
Me.DetailsLayoutPanel.SuspendLayout()
Me.SuspendLayout()
'MainLayoutPanel
Me.MainLayoutPanel.BackgroundImage =

37

CType(resorces.GetObject("MainLayoutPanel.BackgroundIm
age"), _
System.Drawing.Image)
Me.MainLayoutPanel.BackgroundImageLayout =
System.Windows.Forms.ImageLayout.Stretch
Me.MainLayoutPanel.ColumnCount = 2
Me.MainLayoutPanel.ColumnStyles.Add(New _
System.Windows.Forms.ColumnStyle(System.Windows.Form
s.SizeType.Absolute, 243.0!))
Me.MainLayoutPanel.ColumnStyles.Add(New _
System.Windows.Forms.ColumnStyle(System.Windows.Form
s.SizeType.Absolute, 100.0!))
Me.MainLayoutPanel.Controls.Add(Me.DetailsLayoutPanel,
1, 1)
Me.MainLayoutPanel.Controls.Add(Me.ApplicationTitle,
1, 0)
Me.MainLayoutPanel.Dock =
System.Windows.Forms.DockStyle.Fill
Me.MainLayoutPanel.Location = New
System.Drawing.Point(0, 0)
Me.MainLayoutPanel.Name = "MainLayoutPanel"
Me.MainLayoutPanel.RowStyles.Add(New _
System.Windows.Forms.RowStyle(System.Windows.Forms.S
izeType.Absolute, 218.0!))
Me.MainLayoutPanel.RowStyles.Add(New _
38

System.Windows.Forms.RowStyle(System.Windows.Forms.S
izeType.Absolute, 38.0!))
Me.MainLayoutPanel.Size = New
System.Drawing.Size(496, 303)
Me.MainLayoutPanel.TabIndex = 0
'DetailsLayoutPanel
Me.DetailsLayoutPanel.Anchor =
System.Windows.Forms.AnchorStyles.None
Me.DetailsLayoutPanel.BackColor =
System.Drawing.Color.Transparent
Me.DetailsLayoutPanel.ColumnCount = 1
Me.DetailsLayoutPanel.ColumnStyles.Add(New _
System.Windows.Forms.ColumnStyle(System.Windows.Form
s.SizeType.Absolute, 247.0!))
Me.DetailsLayoutPanel.ColumnStyles.Add(New _
System.Windows.Forms.ColumnStyle(System.Windows.Form
s.SizeType.Absolute, 142.0!))
Me.DetailsLayoutPanel.Controls.Add(Me.Version, 0, 0)
Me.DetailsLayoutPanel.Controls.Add(Me.Version, 0, 1)
Me.DetailsLayoutPanel.Location = New
System.Drawing.Point(246, 221)
Me.DetailsLayoutPanel.Name = "DetailsLayoutPanel"
Me.DetailsLayoutPanel.RowStyles.Add(New _
System.Windows.Forms.RowStyle(System.Windows.Forms.S
izeType.Absolute, 33.0!))
Me.DetailsLayoutPanel.RowStyles.Add(New _
39

System.Windows.Forms.RowStyle(System.Windows.Forms.S
izeType.Absolute, 33.0!))
Me.DetailsLayoutPanel.Size = New
System.Drawing.Size(247, 79)
Me.DetailsLayoutPanel.TabIndex = 1
'Version
Me.Version.Anchor =
System.Windows.Forms.AnchorStyles.None
Me.Version.BackColor =
System.Drawing.Color.Transparent
Me.Version.Font = New
System.Drawing.Font("Microsoft Sans Serif", 9.0!, _
System.Drawing.FontStyle.Regular,
System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Version.Location = New System.Drawing.Point(3, 9)
Me.Version.Name = "Version"
Me.Version.Size = New System.Drawing.Size(241, 20)
Me.Version.TabIndex = 1
Me.Version.Text = "Version{0}.{1:00}"
'Copyright
Me.Copyright.Anchor =
System.Windows.Forms.AnchorStyles.None
Me.Copyright.BackColor =
System.Drawing.Color.Transparent
Me.Copyright.Font = New
System.Drawing.Font("Microsoft Sans Serif", 9.0!, _
40

System.Drawing.FontStyle.Regular,
System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Copyright.Location = New System.Drawing.Point(3,
39)
Me.Copyright.Name = "Copyright"
Me.Copyright.Size = New System.Drawing.Size(241, 40)
Me.Copyright.TabIndex = 2
Me.Copyright.Text = "Copyright"
'ApplicationTitle
Me.ApplicationTitle.Anchor =
System.Windows.Forms.AnchorStyles.None
Me.ApplicationTitle.BackColor =
System.Drawing.Color.Transparent
Me.ApplicationTitle.Font = New
System.Drawing.Font("Microsoft Sans Serif", 18.0!, _
System.Drawing.FontStyle.Regular,
System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.ApplicationTitle.Location = New
System.Drawing.Point(246, 3)
Me.ApplicationTitle.Name = "ApplicationTitle"
Me.ApplicationTitle.Size = New
System.Drawing.Size(247, 212)
Me.ApplicationTitle.TabIndex = 0
Me.ApplicationTitle.Text = "CyberAdministrator"
Me.ApplicationTitle.TextAlign =
System.Drawing.ContentAlignment.BottomLeft
'SplashScreen1
41

Me.AutoScaleDimensions = New
System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode =
System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(496, 303)
Me.ControlBox = False
Me.Controls.Add(Me.MainLayoutPanel)
Me.FormBorderStyle =
System.Windows.Forms.FormBorderStyle.FixedSingle
Me.MaximizeBox = False
Me.MaximizeBox = False
Me.Name = "SplashScreen1"
Me.ShowInTaskbar = False
Me.StartPosition =
System.Windows.Forms.FormStartPosition.CenterScreen
Me.MainLayoutPanel.ResumeLayout(False)
Me.DetailsLayoutPanel.ResumeLayout(False)
Me.ResumeLayout(False)
End Sub
End Class
Public NotInheritable Class SplashScreen1
Private Sub SplashScreen1_Load(ByVal Sender As Object,
ByVal e As System.EventArgs) Handles Me.Load
Version.Text = System.String.Format(Version.Text,
My.Application.Info.Version.Major, _
My.Application.Info.Version.Minor)
Copyright.Text = My.Application.Info.Copyright
End Sub
End Class
42

<Global.Microsoft.VisualBasic.CompilerServices.DesignerGe
nerated()> _
Partial Class LoginForm1
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As
Boolean)
If disposing Then
If Not (Components Is Nothing) Then
Components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
Friend WithEvents LogoPictureBox As
System.Windows.Forms.PictureBox
Friend WithEvents UsernameLabel As
System.Windows.Forms.Label
Friend WithEvents PasswordLabel As
System.Windows.Forms.Label
Friend WithEvents UsernameTextBox As
System.Windows.Forms.TextBox
Friend WithEvents PasswordTextBox As
System.Windows.Forms.TextBox
Friend WithEvents Ok As System.Windows.Forms.Button
Friend WithEvents Cancel As
System.Windows.Forms.Button
'Required by the Window From Designer
43

Private Components As
System.ComponentModel.IContainer
'NOTE:the following procedure is required by the window
form designer
'it can be modified using the window form designer
'do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub Initializecomponent()
Dim resorces As
System.ComponentModel.ComponentResourceManager = _
New
System.ComponentModel.ComponentResourceManager(GetT
ype(LoginForm1))
Me.LogoPictureBox = New
System.Windows.Forms.PictureBox
Me.UsernameLabel = New
System.Windows.Forms.Label
Me.PasswordLabel = New
System.Windows.Forms.Label
Me.UsernameTextBox = New
System.Windows.Forms.TextBox
Me.PasswordTextBox = New
System.Windows.Forms.TextBox
Me.Ok = New System.Windows.Forms.Button
Me.Cancel = New System.Windows.Forms.Button
CType(Me.LogoPictureBox,
System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
44

'LogoPictureBox
Me.LogoPictureBox.Image =
CType(resorces.GetObject("LogoPictureBoxImage"), _
System.Drawing.Image)
Me.LogoPictureBox.Location = New
System.Drawing.Point(0, 0)
Me.LogoPictureBox.Name = "Me.LogoPictureBox"
Me.LogoPictureBox.Size = New
System.Drawing.Size(165, 193)
Me.LogoPictureBox.TabIndex = 0
Me.LogoPictureBox.TabStop = False
'UsernameLabel
Me.UsernameLabel.Location = New
System.Drawing.Point(172, 24)
Me.UsernameLabel.Name = "UsernameLabel"
Me.UsernameLabel.Size = New
System.Drawing.Size(220, 23)
Me.UsernameLabel.TabIndex = 0
Me.UsernameLabel.Text = "&Username"
Me.UsernameLabel.TextAlign =
System.Drawing.ContentAlignment.MiddleLeft
'Password
Me.PasswordLabel.Location = New
System.Drawing.Point(172, 81)
Me.PasswordLabel.Name = "PasswordLabel"
45

Me.PasswordLabel.Size = New
System.Drawing.Size(220, 23)
Me.PasswordLabel.TabIndex = 0
Me.PasswordLabel.Text = "&Password"
Me.PasswordLabel.TextAlign =
System.Drawing.ContentAlignment.MiddleLeft
'UsernameTextBox
Me.UsernameTextBox.Location = New
System.Drawing.Point(174, 44)
Me.UsernameTextBox.Name = "UsernameTextBox"
Me.UsernameTextBox.Size = New
System.Drawing.Size(220, 20)
Me.UsernameTextBox.TabIndex = 1
'PasswordTextBox
Me.PasswordTextBox.Location = New
System.Drawing.Point(174, 101)
Me.PasswordTextBox.Name = "PasswordTextBox"
Me.PasswordTextBox.PasswordChar =
Global.Microsoft.VisualBasic.ChrW(42)
Me.PasswordTextBox.Size = New
System.Drawing.Point(220, 20)
Me.PasswordTextBox.TabIndex = 3
'OK
Me.Ok.Location = New System.Drawing.Point(197, 161)
Me.Ok.Name = "OK"
Me.Ok.Size = New System.Drawing.Size(94, 23)
46

Me.Ok.TabIndex = 4
Me.Ok.Text = "&OK"
'Cancel
Me.Cancel.DialogResult =
System.Windows.Forms.DialogResult.Cancel
Me.Cancel.Location = New System.Drawing.Point(300,
161)
Me.Cancel.Name = "Cancel"
Me.Cancel.Size = New System.Drawing.Size(94, 23)
Me.Cancel.TabIndex = 5
Me.Cancel.Text = "&Cancel"
'LoginForm1
Me.AcceptButton = Me.Ok
Me.AutoScaleDimensions = New
System.Drawing.Size(6.0!, 13.0!)
Me.AutoScaleMode =
System.Windows.Forms.AutoScaleMode.Font
Me.CancelButton = Me.Cancel
Me.ClientSize = New System.Drawing.Size(401, 192)
Me.Controls.Add(Me.Cancel)
Me.Controls.Add(Me.Ok)
Me.Controls.Add(Me.PasswordTextBox)
Me.Controls.Add(Me.UsernameTextBox)
Me.Controls.Add(Me.PasswordLabel)
Me.Controls.Add(Me.UsernameLabel)
Me.Controls.Add(Me.LogoPictureBox)
Me.FormBorderStyle =
System.Windows.Forms.FormBorderStyle.FixedDialog
47

Me.MaximizeBox = False
Me.MinimizeBox = False
Me.Name = "LoginForm1"
Me.SizeGripStyle =
System.Windows.Forms.SizeGripStyle.Hide
Me.StartPosition =
System.Windows.Forms.FormStartPosition.CenterParent
Me.Text = "LoginForm1"
CType(Me.LogoPictureBox,
System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
End Class
Public Class LoginForm1
Dim admin As New Myconnection
Dim adminds As New DataSet
Private Sub OK_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles Ok.Click
If adminds.Tables("admin").Rows.Count = 0 Then
Dim dr As DataRow =
adminds.Tables("admin").NewRow
dr.Item(0) = UsernameTextBox.Text
dr.Item(1) = PasswordTextBox.Text
adminds.Tables("admin").Rows.Add(dr)
admin.updatead()
Else
If UsernameTextBox.Text =
adminds.Tables("admin").Rows(0).Item(0).ToString And _
48

PasswordTextBox.Text =
adminds.Tables("admin").Rows(0).Item(1).ToString Then
Me.Close()
Else
MsgBox("Invalid Password")
End If
End If
End Sub
Private Sub Cancel_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles Cancel.Click
Me.Close()
End Sub
Private Sub LoginForm1_Load(ByVal sender As
System.Object, ByVal e As System.EventArgs) _
Handles MyBase.Load
adminds = admin.getdata("select * from admin",
"admin")
End Sub
End Class

SCREENSHOT OF THE PROGRAM

49

50

51

Testing
Introduction:
Testing performs a very critical role for quality
assurance and for ensuring the reliability of
software. Testing is done to check whether the
proposed system works as required by the client.
During testing we also check whether for the given
input the expected output is obtained or not.
It also helps in the rectification of errors in the
system. In this project we perform system testing.
52

Testing for this system is done as follows:


1.

Validation and Authentication of clients can


be done by checking the inputted Username and
Password is valid or not.
2.
Login to the client system can be done by
entering a valid username and password, and by
clicking OK button provided on the client login
screen.

53