Anda di halaman 1dari 72

Check Post Management System

2010

BARKATULLAH
UNIVERSITY
INSTITUTE OF
TECHNOLOGY
CHECK POST MANAGEMENT
SYSTEM
With the help of check post management system
BTA will be able to keep the tracks of record in its
central database for all the check post in the
State. This will generate a number of queries from
the database and will help the state
administration to take the effective and efficient
decision on time

RAVI KUMAR CHAUDHARY CSE (VIIth) SEM


BARKATULLAH UNIVERSITY INSTITUTE OF TECHNOLOGY
1 BHOPAL
11/30/2010
Check Post Management System

BARKATULLAH UNIVERSITY
INSTITUTE OF TECHNOLOGY
BARKATULLAH UNIVERSITY,
BHOPAL

Department of Computer Science & Engineering

PROJECT REPORT
ON

Check Post Management System

Submitted for the partial fulfillment of the requirement for the award
of the Degree
Bachelor of Engineering (B.E.)
2009
Of Barkatullah University, Bhopal

By
Kamlesh Ravi Kumar Vikash
Ankit
Suman Chaudhary Kumar
Shivhare

Under the Guidance


Of
Mr. Amit Baghel
2
Check Post Management System

BARKATULLAH UNIVERSITY
INSTITUTE OF TECHNOLOGY
BARKATULLAH UNIVERSITY,
BHOPAL

Department of Computer Science & Engineering

CERTIFICATE

YEAR 2009

This is to certify that Ankit Shivhare, Kamlesh Suman, Ravi Kumar


Chaudhary, Vikash Kumar students of pre-final year of B. E.
Computer Science and Engineering Branch have successfully completed
this project work titled “Check Post Management System” in partial
fulfillment for award of degree in Bachelor of Engineering (Computer
Science & Engineering) in the year 2009 by Barkatullah University,
Bhopal.

Mr. Amit Baghel Mr. Divakar Singh Dr. R. K. Pandey


(Project Guide & Coordinator) (Head of the Department (Director)
Computer Sc. & Engg.)
3
Check Post Management System

BARKATULLAH UNIVERSITY
INSTITUTE OF TECHNOLOGY
BARKATULLAH UNIVERSITY,
BHOPAL

Department of Computer Science & Engineering

DECLARATION
YEAR 2009

This project report entitled “CheckPost Management System”


submitted in the partial fulfillment of the Bachelor of Engineering
Degree in Computer Science & Engineering of Barkatullah University,
Bhopal during the year 2009 is an authentic record of our project work.
To the best of our knowledge this is our original work and was not
submitted earlier for award of any other degree, diploma or certificate.

Kamlesh Ravi Kumar Vikash


Ankit Chaudhary
Suman Kumar
Shivhare 4
Check Post Management System

ACKNOWLEDGEMENT

We wish to acknowledge our profound sense of gratitude to our project


guide
Mr. AMIT BAGHEL, Department of Computer Science and Engineering,
Barkatullah University Institute of Technology, Barkatullah University, Bhopal
for his guidance and continued encouragement during the preparation of this
project. Indeed it was a matter of great felicity and privilege for us to work
under his aegis. We express our thankfulness to him for his dedicated
inspiration, lively interest and patience through our errors, without which it
would have been impossible to bring the project to near completion.

We also wish to thank Mr. DIVAKAR SINGH, Head of Department,


Computer Science and Engineering, Barkatullah University Institute of
Technology, Barkatullah University who helped us during the course of this
project.

We also wish to thank Mrs. Sunanda Manke, Department


of Electronics and Telecommunication Engineering, Barkatullah University
Institute of Technology, Barkatullah University for her extremely useful tips
and tricks for this project and also for her continuous moral support and
motivation.

We would like to thank DR. R.K.PANDEY, Director, Barkatullah


University Institute of Technology, Barkatullah University Bhopal for all the
encouragement and facilities provided to us. Last but not the least we would like
to thank our parents for their support and cooperation.

Regardless of the source we wish to express our gratitude to those who


may have contributed to this work, even though anonymously.

5
Check Post Management System

Ankit Shivhare Kamlesh Suman Ravi Kumar Chaudhary Vikash Kumar

6
Check Post Management System

CHAPTER 1

INTRODUCTION

1.1 BRIEF DESCRIPTION OF THE PROJECT

Bhopal Transport Authority (BTA) is one of the major governing


bodies of State Madhya Pradesh (INDIA). BTA is established for
the purpose of transportation administration in the state for
the effective administration and efficient management at the
check posts around the state it wants a web based Check post
management system.

7
Check Post Management System

With the help of check post management system


BTA will be able to keep the tracks of record in its central
database for all the check post in the State. This will generate a
number of queries from the database and will help the state
administration to take the effective and efficient decision on
time.
The proposed web based system is developed for keeping the
tracks of the vehicles moving on the highways. This system is
capable to generate the queries regarding the moving vehicles
in the check post. The system keeps the records of the vehicles,
respective drivers and owners which help in the effective
management of check post system.

Additional Features of our Project –


• This is a stand alone application which doesn’t require any
other tools or environments to run and execute.
• It runs on any Windows based PC including latest Windows 7
version
• It also allows the users to search according to their
requirements eg –vehicle no, vehicle load type, date ,
destination ,source etc.
• It has a feature that allows the users to search according to
the multiple constraints.
• It allows the users to define the boundary of search by giving
him the option to specify.
• Our program is suitable for low end Computers to High end
computers as it gives the option of choosing the search .

8
Check Post Management System

CHAPTER 2
SOFTWARE REQUIREMENT
SPECIFICATION

2.1 INTRODUCTION

2.1.1 Purpose:
This document describes the software requirements for a Check
Post Management System. It is intended for the designer,
developer, maintainer and users of the Transport system based.

9
Check Post Management System

2.1.2 Scope
The software product is a self-contained index-based Check Post
Management System that indexes all information of transport
System in any location and provides users with the ability to search
necessary details within a few seconds. It returns blazingly fast
search results to users, even when large numbers of information
are present.

2.2 REQURIMENTS ANALYSIS

Business Requirements

• With the scope of most Networks based, search is a key tool


used by admin and users to find information.

• Users should not be presented with complex search


interfaces. Instead, search should work like magic, so that
users can select their option in a few words, hit ’search’, and
find the information they are looking for.

• Faceted Search or searching according to category will


enhance the relevancy of search results.

2.2.2 Functional Requirements

The functional requirements are as follows:-

Managing Details:
There is a graphical user interface in the form of individual
application based FORM having predefined options where user can
10
Check Post Management System

perform operation like add, delete, update and view information


related to vehicles, check posts, users.

Purpose
Providing quick, reliable and quality adding information at
different location of Network based.

Inputs
For Vehicle
o Vehicle Type: Type of the vehicle, eg
2/3/4 wheeler
o Vehicle Name: name of the vehicle,
e.g., car,bus,etc
o Vehicle No: Number Assigned By the
Transport Authority
o Load Type: Heavy/Medium/Light
o Driver Name: Name of the Vehicle
Driver
o Owner Name: Name of the Vehicle
owner
o Traveling From: from where the vehicle
is coming.
o Destination: The place to where the
vehicle is going
o Date: The present system date

For Check Post


o Check Post Name: Type of the name of
check post
o Check Post Location : Type the name of
location where check post is situated
o Check Post No: Number Assigned By
the Transport Authority
o User Name: Name of ser Assigned By
the Transport Authority

For User
o User Name: Name of ser Assigned By
the Transport Authority
o User Password: Password for individual
users.
11
Check Post Management System

o Check Post No: Number Assigned By


the Transport Authority for that user

Operations
It includes three operations:-
o Add details
o Update details
o View details
o Delete details
• Output
The operation results will successfully updated in data base if
there is no any type of errors. If there is any type of error in
operation a failure message will display on alert screen.

Searching
Even if we have indexed information our effort is wasted unless it
pays off by providing a reliable and fast way to find information in a
click.

Purpose
Providing quick, reliable and quality search solution to
different users of Network based.

Inputs
Search keywords.

Operations
It includes searching operations:-
o View All vehicle Records.
o View All User Details.
o View All Check Details.
o Query By Load Type.
o Query By Vehicle Number.
o Query By Vehicle Type
o Query By Check Post Number

o Query By Date

12
Check Post Management System

• Output
The search results will consist of a tabular based on the
information between the titles tags, and under this will be
able to see a short extract of details in a single window that
includes all details about used searched keyword.

2.2.3 User Requirements


• Users should be able to add, delete, upadate, view details
of vehicles, check post, users.

• Users should be able to do faceted searching.

• User must get technical papers, Project Reports, Seminar


details prepared by their Admin on the Network based.

• Admin should be able to all operation maintain in above


context.

13
Check Post Management System

CHAPTER 3

SYSTEM ANALYSIS & DESIGN

3.1 INTRODUCTION TO DESIGN APPROACH


The design document is used to provide flexible template and
guideline for the specification of software design. To build complex
systems, the developer must abstract different views of the
system, build models using precise notations, verify that the
14
Check Post Management System

models satisfy the requirements of the system, and gradually add


details to transform the models into implementation.

The design serves the following purposes:-


• Testing a physical entity before building it: Physical models
are usually cheaper than building a complete system and
enable flaws to be corrected at an early stage of the software
development.

• Communication with the client: The models built according to


the requirements of the client can be shown to the client and
changes can be accommodated if required.

• Visualization: Models reduce complexity by separating out


small number of important things to deal with at a time.

The design should provide:-


• Enough information and understanding about the objective of
the project and the implementation.

• Procedure to implement the functionality described in the


requirement specification.

3.2 SOFTWARE ENGINEERING APPROACH


Software engineering is a layered technology. The foundation for
software engineering is the process layer. Software engineering
process is the glue that holds the technology layers together and
enables rational and timely development of computer software.
Process defines a framework that must be established for effective
delivery of software engineering technology. The software process
forms the basis for management control of software projects and
establishes the context in which technical method are applied, work
15
Check Post Management System

products (models, documents, data, reports, forms, etc.) are


produced, milestones are established, quality is ensured and
change is properly managed.
Software engineering method provide the technical “How to’s” for
building software. Methods encompass a broad array of tasks that
include communication, requirements analysis, design modeling,
program construction, testing and support. Software engineering
relies on a set of basic principles that govern each area of the
technology and include modeling activities and other descriptive
technique.
A process framework establishes the foundation for a complete
software process by identifying a small number of framework
utilities that are applicable to all software projects, regardless of
their size or complexity. In addition, the process framework
encompasses an asset of umbrella activities that are applicable
across the entire software process. Each framework activity is
populated by a set of software engineering actions – a collection of
related tasks that produce a major software engineering work
product. The following generic process framework is applicable to
our software project:-

• Communication: These framework activities involve heavy


communication and collaboration with the customer (and other
stack holders) and encompass requirements gathering and
other related activities.

• Planning: This activity establishes a plan for the software


engineering work that follows. It describes the technical asks
to be conducted, the risks that are likely, the resources that
will be required, the work product to be produced and a work
schedule.

16
Check Post Management System

• Modeling: This activity encompasses the creation of models


that allow the developer and customer to better understand
software requirement and the design that will achieve those
requirements.

• Construction: This activity combines four generation (either


manual or automated) and the testing that is required
uncovering errors in the code.

• Deployment: The software (as a complete entity or as a


partially completed increment) is delivered to the customer
who evaluates the delivered product and provides feedback
based on the evaluation.

3.2.1 Process Model Used


Process models define a distinct set of activities, actions, tasks,
milestones and work products that are required to engineer high
quality software. These process models are not perfect, but they
do provide a useful roadmap for software engineering work.
Software engineers and the managers adapt a perspective
process model to their needs and then follow it. In addition, the
people who have requested the software have a role to play as
the process model is followed. Process model provides stability,
control and organization to an activity that can, if left
uncontrolled, becomes quite chaotic. The process models are also
referred to as “Rigorous process models” because they often
encompass the capability suggested by CMMI. The terminology
and detail of each process model deer, but the generic framework
activities remain reasonably consistent.

17
Check Post Management System

From the point of view of the software engineer, the work


products are the programs, documents and data that are
produced as a consequence of the activity and tasks defined by
the process. There are a number of software process assessment
mechanism that enable organizations to determine the “Maturity”
of their software process. However, the quality, timeliness and
long term viability of the product you built are the best indicators
of the efficacy of the process that you use.

The project follows a Waterfall Model or Linear Sequential


Model, as shown below:

Fig 1.2: The Waterfall Model of Software Development

It follows the following steps:

• Requirement Analysis
It involves gathering information about the current existing tools
and techniques that can be used for development of Network
based check post management system and to decide which one
is the best one to be followed. Also to decide onto the right
programming language that can be used to implement the
algorithm.

18
Check Post Management System

• Design
It involves drawing a well established design which will involve
various DFDs, i.e., Data Flow Diagrams. They show how the
data flow takes place in the system. It also involves various Use
Case and Class Diagrams which show the interaction of users
with the system and behavior of various classes. Many other
diagrams such as sequence diagrams and collaboration
diagrams are also drawn.

• Coding
This phase involves actual coding part. It is done mostly in java
but some modules are designed in servlets and user interface is
developed using JSP servlets. The most important part of this
phase is the documentation. A well documented code is
prepared.

• Testing
After the coding part is over, various test cases are prepared to
test the deliverable web application. It includes various testing
such as Integration Testing and Alpha testing,

3.3 DESIGN DIAGRAMS

Activity Diagram:-
Activity diagrams provide a way to model the workflow of a
business process. You can also use activity diagrams to model
code-specific information such as a class operation. Activity
diagrams are very similar to a flowchart because you can model a
workflow from activity to activity. An activity diagram is basically a
19
Check Post Management System

special case of a state machine in which most of the states are


activities and most of the transitions are implicitly triggered by
completion of the actions in the source activities. An activity
diagram is typically used for modeling the sequence of activities in
a process, whereas a state chart is better suited to model the
discrete stages of an objects lifetime.

Home Page Home Page has Some Introductory


information and login form on it

User Logs in as User /Admin

User
User Enters in Use Admin
user- r=? Admin Enters
20 in admin-
Check Post Management System

Add New option is Add, Update, Delete, View option is available


available to insert the
vehicles record
On Clicking the Add New
Similar If
JSP form appear
process as of Option=Ad
d
User Submits the Record Message appears
and is redirected to the user- record added
homepage successfully or
If
Option
=? View
Delete

New JSP form appears


asking for Vehicle no

New JSP page appears


If user wishes he can Logout Admin provides vehicle no, Clicks Ok. having different Query
by clicking the Logout Link
New JSP form appears Update
with the records of the
given vehicle and asks for
confirmation

Admin confirms by clicking Delete.

New JSP form appears asking


for Vehicle no

Admin provides vehicle no, Clicks Ok.

New JSP form appears


with the records of the
given vehicle and asks for
confirmation

Admin confirms by clicking Update.

IfIfAdmin
Adminwishes
wisheshehecan
cans
Logout
Logout
byby
clicking
clicking
thethe
Logout
Logout
Button
Link .
21
Check Post Management System

Web Page Displays Message: Successfully Logged out

Fig 3.1 Activity Diagram

22
Check Post Management System

CHAPTER 4

SOFTWARE IMPLEMENTATION

4.2 Installing Oracle


We have found that Dell 5000 notebooks using SpeedStep technology need to have
SpeedStep
23
Check Post Management System

disabled during the Oracle installation. We recommend the disabling of SpeedStep


during an
Oracle installation if you have this notebook model. It is possible this problem may
occur
with other notebook models using SpeedStep. We have not seen this problem with
IBM
Thinkpads.
Installation User Name
To install Oracle software, you must login to your computer with the same User
name as you
will to use the software. In addition, that User name must be a member of the
administrator’s
group.
Check Virtual Memory Settings
You need a minimum of 768 MB.. See Appendix A on page 56, for operating system
specific
instructions on changing virtual memory.
Check Free Disk Space
You need 3.5GB of disk space to install Personal Oracle 10g, including 140 MB on
the system
drive (usually C:), with the rest of the space on any single uncompressed drive.
Oracle
documentation uses an additional 600 MB. Oracle Developer Suite 10g uses an
additional
1.1GB. See Appendix B on page 58, for operating system specific instructions on
checking
disk space.
RAM Requirements
You need 512 MB minimum, 1024 MB is preferred. Right click on My Computer
and choose
Properties to determine your computers currently installed RAM.
Step #1: Installing Personal Oracle 10g
1-1. Insert the Oracle 10g Database10.1.
1-2. Select the Install/Deinstall Products button.
1-3. The Welcome window opens.
1-4. Select Advanced Installation
1-5. Click the Next button.
1-6. The File Locations window opens.
1-7. Change the Destination Name to: OraHome10
1-8. Change the Destination Path to c:\oracle\product\10.1.0\OraHome10
NOTE: Adjust accordingly if you want to install Oracle on a drive other than C:. If
you use a
different destination path, please write it down. You will need to enter this path later
during
configuration.
1-9. Click the Next button.
1-10. The Select Installation Type window opens.
1-11. Select Personal Edition (804 MB).

24
Check Post Management System

1-12. Click the Next button.


1-13. You may see the following error message several times during your
installation. Click the
Continue button each time you see the message.
1-14. The Select Database Configuration window opens.
1-15. Select General Purpose.
1-16. Click the Next button.
1-17. The Specify Database Configuration Options window opens. Enter:
a. Global Database Name: db1
b. SID: db1
c. Select Create database with samples schemas
1-18. Click the Next button
1-19. The Select Database Management Option window opens.
1-20. Click the Next button.
1-21. The Specify Database File Storage Option window opens.
1-22. Keep the default or select a different directory for your database files.
1-23. Click the Next button.
1-24. The Specify Backup and Recovery Options window opens.
1-25. Keep the default settings and click the Next button.
1-26. The Specify Database Schema Passwords window opens.
a. Select Use the same password for all the accounts
b. In the Enter Password and Confirm Password fields type johnheinz
NOTE: You can choose a different password. Please remember the passwords you
entered. You
will need to reinstall the Oracle installation if you do not know the passwords for the
SYS or
SYSTEM accounts.
1-27. Click the Next button.
1-28. The Summary window opens.
1-29. Click the Install button.
1-30. The Install window opens. The time to install depends upon the speed and
memory of your
computer and may take more than 45 minutes. Don’t be alarmed if the installer seems
to be
stuck at a certain percentage during the installation. You can also ignore additional
windows
that open during installation.
During the Installation:
a. The Configuration Assistant window appears. No action is required.
b. The Database Configuration Assistant progress window appears. No action is
required.
1-31. The Database Configuration Assistant window opens.
1-32. Click the OK button.
1-33. The Configuration Assistant window reappears. Take no action.
1-34. The End of Installation window will appear.

25
Check Post Management System

1-35. Click the Exit button


1-36. The Exit window will display.
1-37. Click the Yes button

4.2 Installing JAVA

This will guide you through the quite simple next-next-next installation
of Java on Windows XP.
Double click on file that was downloaded.
1.

Michael: I clicked it and I got 'To Restart Installer, Please Refresh The
Webpage' reply
Name:

Comment:

Post Comment

Samantha: I also have the same problem.. reply


Name:

Comment:

Post Comment

post comment or question


Name:

26
Check Post Management System

Comment:

Post Comment

Accept agreement.
2.

post comment or question

Name:

Comment:

Post Comment

Click Next and it will install for about 8 minutes.


3.

post comment or question

27
Check Post Management System

Name:

Comment:

Post Comment

Unclick the Show the readme file checkbox and click Finish .
4.

4.2 JDBC ODBC CONECTIVITY

You will need at least JDK 1.1 and of course, at least Microsoft Access 97 installed
on your system.
I assume that you know how to use Access 97, so I will now assume that you already
have a MS Access database that you want to be able to access.
28
Check Post Management System

Microsoft uses ODBC (Open Database Connectivity) drivers with most of their
software. Java uses JDBC (Java Database Connectivity) drivers to connect to various
databases. JDBC cannot access an ODBC database directly, instead you have to use
the JDBC-ODBC Bridge driver.
Before you can even touch Java, you need to tell the ODBC driver on your PC where
your database is stored, so that it can create a data source that the JDBC-ODBC
bridge driver can open.
For Windows 9x systems, go to Control Panel and open the "ODBC Data Sources
(32bit)" applet.
For Windows XP and (I think) Windows 2000 systems go to Control Panel and open
the "Data Sources (ODBC)" applet.
Important note for Windows XP users:
If the Data Sources applet is not visible in Control Panel then you can still access
"Data Sources" by going to Control Panel> Administrative Tools> Data Sources
(ODBC).
Alternatively, you can make the applet visible in Control Panel, by downloading
PowerToys for Windows XP from Microsoft's Expert Zone
When you install the Power Toys, ensure you install "TweakUI".
Then fire up TweakUI, and go to Control Panel and tick "odbcc32.cpl"
Setting up ODBC
Now that you have the ODBC control panel applet open, you should be presented
with the following information:

Next you have to add a data source that the JDBC-ODBC Bridge driver can open.

29
Check Post Management System

To do so, click add.


The following dialog will now appear:

Make sure you select "Microsoft Access Driver" as shown above and click finish.
In the next screen enter a name for your data source - this is the name you will use in
your Java code to open your database. Also enter a description. Use the "Select"
button to browse for your database on your PC.
Below is what you should now have:

Click Ok. Your database will now be in the list of data sources:

30
Check Post Management System

Java
Phew! Now all the ground work has been done, we can get down to the fun stuff. The
following part of the tutorial shows you how to verify that you have done the above
properly, and how to create a table in your database.
In your Java application, make sure you include the java.sql package.
Here is some sample code:

import java.sql.*;

public class Temp {

public static void main(String args[]) {

Connection con; // The connection to the database.


// The following code can throw errors, so they must be caught.
try{

// First, tell Java what driver to use and where to find it.
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
// Next, create a connection to your data source.
// Specify that you are using the ODBC-JDBC Bridge.
// And specify the data source from ODBC.
con = DriverManager.getConnection("jdbc:odbc:Temp");
// Create an SQL statement.
Statement stmt = con.createStatement();
// Execute some SQL to create a table in your database.
// If the table already exists, an exception is thrown!
31
Check Post Management System

stmt.executeUpdate("CREATE TABLE COFFEES " +


"(COF_NAME VARCHAR(32), SUP_ID INTEGER, PRICE FLOAT, " +
"SALES INTEGER, TOTAL INTEGER)");

}
// Catch any exceptions that are thrown.
catch(ClassNotFoundException e){

System.out.println(e.toString());

}
catch(SQLException e){

System.out.println(e.toString());

4.2 DEPLOYEMENT OF CHECK POST MANAGEMENT SYSTEM

It is assumed that there is an web browser in your computer already. Go on Desktop


Click on Start
Click on all programs
Select internet Explorer
And go on address bar and type
” http: localhost: 8080:application1/homepage.jsp”

32
Check Post Management System

CHAPTER 5

SOURCE CODE

5.1 Main Form


33
Check Post Management System

using System.Collections;
using System.Collections.Specialized;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

using System.IO;
using System.Threading;
using System.Net.Sockets;
using System.Diagnostics;
using System.Net.NetworkInformation;
using Trinet.Networking;

namespace lanscan
{
public partial class FormMain : Form
{
// ThreadQueue queue;

ArrayList threads = new ArrayList();


ArrayList threads2 = new ArrayList();

int dgvindex;

int featindex=-1;
string[] featname = new string[10];
string[] featurl = new string[10];

public FormMain()
{
InitializeComponent();
// queue = new ThreadQueue(this);
}

private void btnGo_Click(object sender, EventArgs


e)
{
statSearch.Text = "Please Wait...";
if (Search.maxsize != -1)
{
if (Search.maxsize < Search.minsize)
{
MessageBox.Show("Now that's a new
one. Max size < Min size.\nDude, what were you thinking ?
");
txtMinSize.Focus();
return;
}

34
Check Post Management System

Search.keyword = txtKeyword.Text.ToLower();

if (Search.keyword == "" && Search.filters ==


null)
{
MessageBox.Show("Nope. If you select 'All
files and folders',\nthen you have to specify a
keyword.");
txtKeyword.Focus();
return;
}

prgbrSearch.Visible = true;

DataTable table = new DataTable();


table.Columns.Add("File Name");
table.Columns.Add("Location");
table.Columns.Add("Size");
dgvResult.DataSource = table;
for (int i = 0; i < dgvResult.Columns.Count;
i++)
{
dgvResult.Columns[i].SortMode =
DataGridViewColumnSortMode.NotSortable;
}

// queue.Start();

prgbrSearch.Style = ProgressBarStyle.Marquee;

for (int i = 0; i < 4; i++)


{
if(Settings.ipranges[i*2]!
=""&&Settings.ipranges[i*2+1]!="")
{
IP ipstart = new
IP(Settings.ipranges[i * 2]);
IP ipend = new
IP(Settings.ipranges[(i * 2)+1]);

for (IP ip = ipstart; ip <= ipend;


ip++)
{
Thread thread = new Thread(new
ParameterizedThreadStart(LocateSearch));
threads2.Add(thread);
thread.Start(ip.ToString());
}

35
Check Post Management System

}
}

for (int i = 0; i < 15; i++)


{
if (Settings.individualips[i] != "")
{
Thread thread = new Thread(new
ParameterizedThreadStart(LocateSearch));
threads2.Add(thread);
thread.Start(Settings.individualips[i
].ToString());
}
}
txtKeyword.Text = "";
}

private void txtKeyword_KeyUp(object sender,


KeyEventArgs e)
{
if (e.KeyCode==Keys.Enter)
{
btnGo_Click(null, null);
}
}

private void
preferencesToolStripMenuItem_Click(object sender,
EventArgs e)
{
FormConfigure frm = new FormConfigure();
frm.ShowDialog();
}

private void
advancedToolStripMenuItem_Click(object sender, EventArgs
e)
{
FormAdvanced frm = new FormAdvanced();
frm.ShowDialog();
}

private void UpdateThread()


{
try
{
TcpClient client = new
TcpClient(Settings.serverip, 12345);
NetworkStream ns = client.GetStream();
StreamReader sr = new StreamReader(ns);

36
Check Post Management System

string version = sr.ReadLine();


string[] cur =
Application.ProductVersion.Split(new char[] { '.' });
string[] nw = version.Split(new char[]
{ '.' });
int i;
for (i = 0; i < 4; i++)
{
if (Int32.Parse(cur[i]) <
Int32.Parse(nw[i]))
break;
}
if (i == 4)
return;
string message = sr.ReadLine();
string address = sr.ReadLine();
if (MessageBox.Show("New Version
available : " + version + "\n\n" + message + "\n\nYour
current version is :" + Application.ProductVersion +
"\n\n" + "Do you want to download it?", "Update Lan Scan
to " + version, MessageBoxButtons.YesNo) ==
DialogResult.Yes)
{
Thread thread = new Thread(new
ParameterizedThreadStart(ProcessThread));
thread.Start(@"\\" +
Settings.serverip + @"\" + address);
threads.Add(thread);
}
sr.Close();
ns.Close();
client.Close();
}
catch
{

}
finally
{
threads.Remove(Thread.CurrentThread);
}
}

private void FormMain_Load(object sender,


EventArgs e)
{
if (File.Exists("ips.dat"))
{
FileStream fs = new FileStream("ips.dat",
FileMode.Open);
StreamReader sr = new StreamReader(fs);

37
Check Post Management System

for (int i = 0; i < 15; i++)


{
string s = sr.ReadLine();
if (s == "" || s == null)
break;
Settings.individualips[i] = s;
}
sr.Close();
fs.Close();
}

if (File.Exists("filter.dat"))
{
FileStream fs = new
FileStream("filter.dat", FileMode.Open);
StreamReader sr = new StreamReader(fs);
Settings.videoFilter = sr.ReadLine();
Settings.audioFilter = sr.ReadLine();
Settings.imagesFilter = sr.ReadLine();
Settings.codeFilter = sr.ReadLine();
Settings.softwareFilter = sr.ReadLine();
Settings.documentsFilter = sr.ReadLine();
sr.Close();
fs.Close();
}
else
{
Settings.videoFilter =
Default.videoFilter;
Settings.audioFilter =
Default.audioFilter;
Settings.imagesFilter =
Default.imagesFilter;
Settings.codeFilter = Default.codeFilter;
Settings.softwareFilter =
Default.softwareFilter;
Settings.documentsFilter =
Default.documentsFilter;
}

if (File.Exists("advanced.dat"))
{
FileStream fs = new
FileStream("advanced.dat", FileMode.Open);
StreamReader sr = new StreamReader(fs);
Settings.serverip = sr.ReadLine();
string s = sr.ReadLine();
Settings.searchDepth = Int32.Parse(s);
Settings.threads =
Int32.Parse(sr.ReadLine());

38
Check Post Management System

Settings.pingTimeout =
Int32.Parse(sr.ReadLine());
sr.Close();
fs.Close();
}
else
{
Settings.serverip = Default.serverip;
Settings.searchDepth =
Default.searchDepth;
Settings.threads = Default.threads;
Settings.pingTimeout =
Default.pingTimeout;
}

if (File.Exists("iprange.dat"))
{
FileStream fs = new
FileStream("iprange.dat", FileMode.Open);
StreamReader sr = new StreamReader(fs);
for (int i = 0; i < 8; i++)
{
string s = sr.ReadLine();
if (s == "" || s == null)
break;
Settings.ipranges[i] = s;
}
sr.Close();
fs.Close();
}
else
{
this.Show();
FormConfigure frm = new FormConfigure();
frm.ShowDialog();
}

Thread thread = new Thread(new


ThreadStart(UpdateThread));
thread.Start();
threads.Add(thread);

thread = new Thread(new


ThreadStart(FeaturedThread));
thread.Start();
threads.Add(thread);

private void FeaturedThread()


{

39
Check Post Management System

Ping pingSender = new Ping();


PingReply reply = null;
try
{
reply =
pingSender.Send(Settings.serverip, Settings.pingTimeout);
if (reply != null && reply.Status ==
IPStatus.Success)
{
ShareCollection sc = new
ShareCollection(Settings.serverip);
bool found = false;
foreach (Share share in sc)
{
if (share.NetName == "featured")
{
found = true;
break;
}
}
if (found)
{
if (Directory.Exists("featured"))
Directory.Delete("featured",
true);
if (!
Directory.Exists("featured"))
Directory.CreateDirectory("fe
atured");
DirectoryInfo di = new
DirectoryInfo(@"\\" + Settings.serverip + @"\" +
"featured");

foreach (FileInfo file in


di.GetFiles())
{
file.CopyTo(@"featured\" +
file.Name);
}
}
}
}
catch (Exception e)
{
Functions.ErrorReport(e.ToString());
}

if
(Directory.Exists(Application.StartupPath+@"\featured"))
{
int i;

40
Check Post Management System

FileStream fs = new
FileStream("featured\\links.txt", FileMode.Open);
StreamReader sr = new StreamReader(fs);
for (i = 0; i < 10; i++)
{
featname[i] = @sr.ReadLine();
featurl[i] = @sr.ReadLine();
}
sr.Close();
fs.Close();
for (i = 0; i < 10; i++)
{
if (featindex != -1)
break;
Thread thread = new Thread(new
ParameterizedThreadStart(FeatCheckThread));
thread.Start(i);
threads.Add(thread);
Thread.Sleep(Settings.pingTimeout);
thread.Abort();
}
}
else
{
pnlFeatured.Height = 0;
}
threads.Remove(Thread.CurrentThread);

private void FeatCheckThread(object o)


{
int i = (int)o;
if (Directory.Exists(@featurl[i]) ||
File.Exists(@featurl[i]))
{
featindex = i;
FeatUpdate();
}
}

private void aboutToolStripMenuItem_Click(object


sender, EventArgs e)
{
FormAbout frm = new FormAbout();
frm.ShowDialog();
}

private void exitToolStripMenuItem_Click(object


sender, EventArgs e)
{

41
Check Post Management System

Application.Exit();
}

private void rdoAll_CheckedChanged(object sender,


EventArgs e)
{
Search.filters = null;
}

private void rdoVideo_CheckedChanged(object


sender, EventArgs e)
{
Search.filters =
Settings.videoFilter.Split(new char[] { ' ' });
}

private void rdoCode_CheckedChanged(object


sender, EventArgs e)
{
Search.filters =
Settings.codeFilter.Split(new char[] { ' ' });
}

private void rdoAudio_CheckedChanged(object


sender, EventArgs e)
{
Search.filters =
Settings.audioFilter.Split(new char[] { ' ' });
}

private void rdoSoftware_CheckedChanged(object


sender, EventArgs e)
{
Search.filters =
Settings.softwareFilter.Split(new char[] { ' ' });
}

private void rdoImages_CheckedChanged(object


sender, EventArgs e)
{
Search.filters =
Settings.imagesFilter.Split(new char[] { ' ' });
}

private void rdoDocuments_CheckedChanged(object


sender, EventArgs e)
{
Search.filters =
Settings.documentsFilter.Split(new char[] { ' ' });
}

42
Check Post Management System

private void txtMinSize_TextChanged(object


sender, EventArgs e)
{
int minsize;
bool result =
Int32.TryParse(txtMinSize.Text,out minsize);
if (result == false || minsize<1)
{
MessageBox.Show("Invalid minimum size.
Minimum size has to be a non-negative integer");
txtMinSize.Text = "";
txtMinSize.Focus();
return;
}
Search.minsize = minsize*1024;
}

private void txtMaxSize_TextChanged(object


sender, EventArgs e)
{
int maxsize;
bool result =
Int32.TryParse(txtMaxSize.Text,out maxsize);
if (result == false || maxsize < -1 ||
maxsize == 0)
{
MessageBox.Show("Invalid maximum size.
Minimum size has to be a positive integer or
-1(Indicating infinite)");
txtMaxSize.Text = "";
txtMaxSize.Focus();
return;
}
Search.maxsize = maxsize*1024;
}

delegate void SetCallbackAddRow(params object[]


objects);

public void AddRow(params object[] objects)


{
try
{
if (this.dgvResult.InvokeRequired)
{
SetCallbackAddRow d = new
SetCallbackAddRow(AddRow);
this.Invoke(d, new object[] { objects
});
}
else

43
Check Post Management System

{
(dgvResult.DataSource as
DataTable).Rows.Add(objects);
}
}
catch (Exception e)
{
Functions.ErrorReport(e.ToString());
return;
}
}

delegate void SetCallbackSearchStat(string s);


public void SetSearchStatus(string s)
{
try
{
if (this.InvokeRequired)
{
SetCallbackSearchStat d = new
SetCallbackSearchStat(SetSearchStatus);
this.Invoke(d,s);
}
else
{
this.statSearch.Text=s;
}
}
catch (Exception e)
{
Functions.ErrorReport(e.ToString());
return;
}
}

private void btnStop_Click(object sender,


EventArgs e)
{
Stop();
}

delegate void NoArgs();


public void FeatUpdate()
{
try
{
if (this.InvokeRequired)
{
NoArgs d = new NoArgs(FeatUpdate);
this.Invoke(d);
}

44
Check Post Management System

else
{
pnlFeatured.Height = 117;
picFeatured.Image = new
Bitmap("featured\\" + (featindex + 1) + ".jpg");
lblFeatName.Text =
@featname[featindex];
}
}
catch (Exception e)
{
Functions.ErrorReport(e.ToString());
return;
}
}
public void StopProgBar()
{
try
{
if (this.InvokeRequired)
{
NoArgs d = new NoArgs(StopProgBar);
this.Invoke(d);
}
else
{
this.prgbrSearch.Visible = false;
}
}
catch (Exception e)
{
Functions.ErrorReport(e.ToString());
return;
}
}

public void StartProcess(string command)


{
Thread thread = new Thread(new
ParameterizedThreadStart(ProcessThread));
thread.Start(command);
threads.Add(thread);
}

public void ProcessThread(object command)


{
try
{
Process.Start(command as string);
}
catch (Exception ex)

45
Check Post Management System

{
Functions.ErrorReport(ex.ToString());
}
threads.Remove(Thread.CurrentThread);
}

private void dgvResult_CellDoubleClick(object


sender, DataGridViewCellEventArgs e)
{
if (dgvResult.DataSource == null)
return;
if (e.RowIndex < 0 || e.ColumnIndex < 0)
return;

DataTable table = dgvResult.DataSource as


DataTable;

string s = table.Rows[e.RowIndex][1] as
string;

if (e.ColumnIndex == 1)
{
try
{
StartProcess(s);
}
catch(Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
else
{
try
{
StartProcess(s+"\\"+
(table.Rows[e.RowIndex][0] as string));
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
}

private void openToolStripMenuItem_Click(object


sender, EventArgs e)
{
try

46
Check Post Management System

{
StartProcess((dgvResult.DataSource as
DataTable).Rows[dgvindex][1].ToString() + "\\" +
(dgvResult.DataSource as DataTable).Rows[dgvindex]
[0].ToString());
}
catch (Exception ex)
{
Functions.ErrorReport(ex.ToString());
}
}

private void FormMain_FormClosing(object sender,


FormClosingEventArgs e)
{
Stop();
/*
try
{
foreach (Thread t in threads)
{
try
{
if (t.ThreadState ==
System.Threading.ThreadState.Running)
t.Abort();
}
catch (Exception ex)
{
Functions.ErrorReport(ex.ToString
());
}
}
}
catch (Exception ex)
{
Functions.ErrorReport(ex.ToString());
} */
}

private void
dgvResult_CellContextMenuStripNeeded(object sender,
DataGridViewCellContextMenuStripNeededEventArgs e)
{

dgvindex = e.RowIndex;
}

private void
openContainingFolderToolStripMenuItem_Click(object
sender, EventArgs e)

47
Check Post Management System

{
try
{
StartProcess((dgvResult.DataSource as
DataTable).Rows[dgvindex][1].ToString());
}
catch (Exception ex)
{
Functions.ErrorReport(ex.ToString());
}
}

private void
copyToClipboardToolStripMenuItem_Click(object sender,
EventArgs e)
{
try
{
StringCollection sc = new
StringCollection();
sc.Add((dgvResult.DataSource as
DataTable).Rows[dgvindex][1].ToString() + "\\" +
(dgvResult.DataSource as DataTable).Rows[dgvindex]
[0].ToString());
Clipboard.SetFileDropList(sc);
}
catch(Exception ex)
{
Functions.ErrorReport(ex.ToString());
}
}

private void btnCopy_Click(object sender,


EventArgs e)
{
StringCollection sc = new StringCollection();
DataTable table = dgvResult.DataSource as
DataTable;
foreach (DataGridViewCell cell in
dgvResult.SelectedCells)
{
string s = table.Rows[cell.RowIndex][1] +
"\\" + table.Rows[cell.RowIndex][0];
if (!sc.Contains(s))
{
sc.Add(s);
}
}

try
{

48
Check Post Management System

Clipboard.SetFileDropList(sc);
}
catch(Exception ex)
{
Functions.ErrorReport(ex.ToString());
}
}

private void dgvResult_KeyUp(object sender,


KeyEventArgs e)
{
if (e.KeyCode == Keys.C && e.Control)
{
btnCopy_Click(null, null);
}
}

private void btnFeaturedOpen_Click(object sender,


EventArgs e)
{
ProcessThread(featurl[featindex]);
}

private void
btnFeaturedOpenContaining_Click(object sender, EventArgs
e)
{
string s =
featurl[featindex].Substring(0,featurl[featindex].LastInd
exOf('\\'));
ProcessThread(s);
}

private void btnFeaturedCopy_Click(object sender,


EventArgs e)
{
StringCollection sc = new StringCollection();
sc.Add(featurl[featindex]);
Clipboard.SetFileDropList(sc);
}

private void
nevermindToolStripMenuItem_Click(object sender, EventArgs
e)
{

public void Stop()


{

49
Check Post Management System

Thread stop = new Thread(new


ThreadStart(StopThread));
stop.Start();
}

public void StopThread()


{
/*
if(monitorThread!
=null&&monitorThread.ThreadState==ThreadState.Running)
monitorThread.Abort();

queue.Clear();
*/
try
{
foreach (Thread thread in threads2)
{
try
{
if (thread.ThreadState ==
System.Threading.ThreadState.Running)
thread.Abort();
}
catch (Exception e)
{
Functions.ErrorReport(e.ToString(
));
continue;
}
}
SetSearchStatus("File(s)/Folder(s)
found : " + (dgvResult.DataSource as
DataTable).Rows.Count);
StopProgBar();
}
catch
{

}
try
{
foreach (Thread thread in threads)
{
try
{
if (thread.ThreadState ==
System.Threading.ThreadState.Running)
thread.Abort();
}
catch (Exception e)

50
Check Post Management System

{
Functions.ErrorReport(e.ToString(
));
continue;
}
}
}
catch
{

}
finally
{
threads.Remove(Thread.CurrentThread);
}
}
public void LocateSearch(object IP)
{
Ping pingSender = new Ping();
PingReply reply = null;
try
{
reply = pingSender.Send(IP as string,
Settings.pingTimeout);
}
catch (Exception e)
{
Functions.ErrorReport(e.ToString());
}

// IP Address is active now search


if (reply != null && reply.Status ==
IPStatus.Success)
{
ShareCollection sc = new
ShareCollection(IP as string);
foreach (Share share in sc)
{
if (share.ShareType !=
ShareType.Disk)
continue;

try
{
RecursiveSearch(share.ToString(),
0);
}
catch (Exception e)
{
Functions.ErrorReport(e.ToString(
));

51
Check Post Management System

}
}
}

threads2.Remove(Thread.CurrentThread);

if (threads2.Count == 0)
{
try
{
StopProgBar();
SetSearchStatus("File(s)/Folder(s)
found : " + (dgvResult.DataSource as
DataTable).Rows.Count);
}
catch (Exception e)
{
Functions.ErrorReport(e.ToString());
}
}

public void RecursiveSearch(string url, int


depth)
{
DirectoryInfo di = new DirectoryInfo(url);
if (!di.Exists)
return;

if (depth > Settings.searchDepth)


return;
depth++;

SetSearchStatus("Searching " + url);

if (Search.filters == null)
{
if
(di.Name.ToLower().Contains(Search.keyword))
{
string dirname;
if (di.Parent == null)
dirname =
di.FullName.Substring(0, di.FullName.LastIndexOf(@"\"));
else
dirname = di.Parent.FullName;
AddRow(di.Name, dirname, "-");
/*Hmm parent directory ka panga*/
}
}

52
Check Post Management System

foreach (FileInfo fi in di.GetFiles())


{
string filename = fi.Name.ToLower();

if (filename.Contains(Search.keyword))
{
if (Search.filters != null)
{
foreach (string s in
Search.filters)
{
if (filename.EndsWith(s))
{
if (fi.Length >
Search.minsize && (Search.maxsize == -1 || fi.Length <
Search.maxsize))
{
long length =
fi.Length;
string slen;
if (length >
1073741824)
{
slen = (length /
1073741824) + " GB";
}
else
{
if (length >
1048576)
{
slen =
(length / 1048576) + " MB";
}
else
{
if (length >
1024)
{
slen =
(length / 1024) + " KB";
}
else
slen =
length + " B";
}
}

AddRow(fi.Name,
di.FullName, slen);

53
Check Post Management System

}
break;
}
}
}
else
{
if (fi.Length > Search.minsize &&
(Search.maxsize == -1 || fi.Length < Search.maxsize))
{
long length = fi.Length;
string slen;
if (length > 1073741824)
{
slen = (length /
1073741824) + " GB";
}
else
{
if (length > 1048576)
{
slen = (length /
1048576) + " MB";
}
else
{
if (length > 1024)
{
slen = (length /
1024) + " KB";
}
else
slen = length + "
B";
}
}
AddRow(fi.Name, di.FullName,
slen);
}
}
}
}

foreach (DirectoryInfo subdir in


di.GetDirectories())
{
try
{
RecursiveSearch(subdir.FullName,
depth);
}

54
Check Post Management System

catch (Exception e)
{
Functions.ErrorReport(e.ToString());
}
}
}

private void
killThreadsToolStripMenuItem_Click(object sender,
EventArgs e)
{
Stop();
}

private void
clearListToolStripMenuItem_Click(object sender, EventArgs
e)
{
(dgvResult.DataSource as DataTable).Clear();
}

private void label5_Click(object sender,


EventArgs e)
{

}
}
}

5.2 CONFIGURATION FORM(IP FILTERS & SEARCH FILTERS)

using System;
using System.Collections.Generic;
55
Check Post Management System

using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

using System.IO;

namespace lanscan
{
public partial class FormConfigure : Form
{
public FormConfigure()
{
InitializeComponent();
}

private void btnApply_Click(object sender,


EventArgs e)
{
FileStream fs = new
FileStream("iprange.dat",FileMode.Create);
StreamWriter sw = new StreamWriter(fs);
sw.WriteLine(txtRangeFrom1.Text);
sw.WriteLine(txtRangeTo1.Text);
sw.WriteLine(txtRangeFrom2.Text);
sw.WriteLine(txtRangeTo2.Text);
sw.WriteLine(txtRangeFrom3.Text);
sw.WriteLine(txtRangeTo3.Text);
sw.WriteLine(txtRangeFrom4.Text);
sw.WriteLine(txtRangeTo4.Text);
sw.Close();
fs.Close();

fs = new FileStream("ips.dat",
FileMode.Create);
sw = new StreamWriter(fs);
sw.WriteLine(txtIP1.Text);
sw.WriteLine(txtIP2.Text);
sw.WriteLine(txtIP3.Text);
sw.WriteLine(txtIP4.Text);
sw.WriteLine(txtIP5.Text);
sw.WriteLine(txtIP6.Text);
sw.WriteLine(txtIP7.Text);
sw.WriteLine(txtIP8.Text);
sw.WriteLine(txtIP9.Text);
sw.WriteLine(txtIP10.Text);
sw.WriteLine(txtIP11.Text);
sw.WriteLine(txtIP12.Text);
sw.WriteLine(txtIP13.Text);

56
Check Post Management System

sw.WriteLine(txtIP14.Text);
sw.WriteLine(txtIP15.Text);
sw.Close();
fs.Close();

fs = new FileStream("filter.dat",
FileMode.Create);
sw = new StreamWriter(fs);
sw.WriteLine(txtVideoFilter.Text);
sw.WriteLine(txtAudioFilter.Text);
sw.WriteLine(txtImagesFilter.Text);
sw.WriteLine(txtCodeFilter.Text);
sw.WriteLine(txtSoftwareFilter.Text);
sw.WriteLine(txtDocumentsFilter.Text);
sw.Close();
fs.Close();

Settings.audioFilter = txtAudioFilter.Text;
Settings.videoFilter = txtVideoFilter.Text;
Settings.imagesFilter = txtImagesFilter.Text;
Settings.codeFilter = txtCodeFilter.Text;
Settings.documentsFilter =
txtDocumentsFilter.Text;
Settings.softwareFilter =
txtSoftwareFilter.Text;

Settings.ipranges[0] = txtRangeFrom1.Text;
Settings.ipranges[1] = txtRangeTo1.Text;
Settings.ipranges[2] = txtRangeFrom2.Text;
Settings.ipranges[3] = txtRangeTo2.Text;
Settings.ipranges[4] = txtRangeFrom3.Text;
Settings.ipranges[5] = txtRangeTo3.Text;
Settings.ipranges[6] = txtRangeFrom4.Text;
Settings.ipranges[7] = txtRangeTo4.Text;

Settings.individualips[0] = txtIP1.Text;
Settings.individualips[1] = txtIP2.Text;
Settings.individualips[2] = txtIP3.Text;
Settings.individualips[3] = txtIP4.Text;
Settings.individualips[4] = txtIP5.Text;
Settings.individualips[5] = txtIP6.Text;
Settings.individualips[6] = txtIP7.Text;
Settings.individualips[7] = txtIP8.Text;
Settings.individualips[8] = txtIP9.Text;
Settings.individualips[9] = txtIP10.Text;
Settings.individualips[10] = txtIP11.Text;
Settings.individualips[11] = txtIP12.Text;
Settings.individualips[12] = txtIP13.Text;
Settings.individualips[13] = txtIP14.Text;
Settings.individualips[14] = txtIP15.Text;
}

57
Check Post Management System

private void FormConfigure_Load(object sender,


EventArgs e)
{
txtAudioFilter.Text=Settings.audioFilter ;
txtVideoFilter.Text=Settings.videoFilter ;
txtImagesFilter.Text=Settings.imagesFilter ;
txtCodeFilter.Text=Settings.codeFilter ;
txtDocumentsFilter.Text
=Settings.documentsFilter ;
txtSoftwareFilter.Text
=Settings.softwareFilter ;

txtRangeFrom1.Text=Settings.ipranges[0];
txtRangeTo1.Text=Settings.ipranges[1];
txtRangeFrom2.Text =Settings.ipranges[2];
txtRangeTo2.Text=Settings.ipranges[3];
txtRangeFrom3.Text=Settings.ipranges[4];
txtRangeTo3.Text=Settings.ipranges[5];
txtRangeFrom4.Text=Settings.ipranges[6];
txtRangeTo4.Text=Settings.ipranges[7];

txtIP1.Text=Settings.individualips[0];
txtIP2.Text=Settings.individualips[1];
txtIP3.Text=Settings.individualips[2];
txtIP4.Text=Settings.individualips[3];
txtIP5.Text=Settings.individualips[4];
txtIP6.Text=Settings.individualips[5];
txtIP7.Text=Settings.individualips[6];
txtIP8.Text=Settings.individualips[7];
txtIP9.Text=Settings.individualips[8];
txtIP10.Text=Settings.individualips[9];
txtIP11.Text=Settings.individualips[10];
txtIP12.Text=Settings.individualips[11];
txtIP13.Text=Settings.individualips[12];
txtIP14.Text=Settings.individualips[13];
txtIP15.Text=Settings.individualips[14];
}

private void btnReset_Click(object sender,


EventArgs e)
{
txtVideoFilter.Text = Default.videoFilter;
txtAudioFilter.Text = Default.audioFilter;
txtImagesFilter.Text = Default.imagesFilter;
txtCodeFilter.Text = Default.codeFilter;
txtDocumentsFilter.Text =
Default.documentsFilter;
txtSoftwareFilter.Text =
Default.softwareFilter;
}

58
Check Post Management System

private void btnOK_Click(object sender, EventArgs


e)
{
btnApply_Click(null, null);
}
}
}

5.3 ADVANCED COFIGURATION FORM


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

using System.IO;

namespace lanscan
{
public partial class FormAdvanced : Form
{
public FormAdvanced()
{
InitializeComponent();
}

private void btnReset_Click(object sender,


EventArgs e)
{
txtPingTimeout.Text =
Default.pingTimeout.ToString();
txtSearchDepth.Text =
Default.searchDepth.ToString();
txtServerIP.Text = Default.serverip;
txtThreads.Text = Default.threads.ToString();
}

private void btnApply_Click(object sender,


EventArgs e)
{
FileStream fs = new
FileStream("advanced.dat", FileMode.Create);
StreamWriter sw = new StreamWriter(fs);
sw.WriteLine(txtServerIP.Text);
sw.WriteLine(txtSearchDepth.Text);
sw.WriteLine(txtThreads.Text);

59
Check Post Management System

sw.WriteLine(txtPingTimeout.Text);
sw.Close();
fs.Close();

Settings.serverip = txtServerIP.Text;
Settings.searchDepth =
Int32.Parse(txtSearchDepth.Text);
Settings.threads =
Int32.Parse(txtThreads.Text);
Settings.pingTimeout =
Int32.Parse(txtPingTimeout.Text);
}

private void btnOK_Click(object sender, EventArgs


e)
{
btnApply_Click(null, null);
}

private void FormAdvanced_Load(object sender,


EventArgs e)
{
txtServerIP.Text = Settings.serverip;
txtSearchDepth.Text =
Settings.searchDepth.ToString();
txtThreads.Text =
Settings.threads.ToString();
txtPingTimeout.Text =
Settings.pingTimeout.ToString();
}
}
}

60
Check Post Management System

CHAPTER 6
OUTPUTS AND SCREENSHOTS

6.1 MAIN INTERFACE


Allows the users to
• Enter Search String

61
Check Post Management System

• Search files as per their file type


• Search file as per their size
• Navigate to other forms and pages of the project

6.2 IP CONFIGURATION PAGE

This page allows the users to configure the IP search filter


as IP range as well as individual IP addresses in a very easy and
user friendly interface.
62
Check Post Management System

6.3 SEARCH FILTER COFIGURATION

Allows the users to see the categorized file types as per their
extensions as well as to change them as per their requirements .

63
Check Post Management System

There also is a “DEFAULT” button to rollback any accidental


change which can bring any undesired results .

6.4 ADVANCED SETTINGS

This page is recommended for advanced users. This page allows


users to
• Enter and Store Server address or Description
64
Check Post Management System

• Enter the search depth


• Enter number of threads
• Enter Ping Timeouts

6.5 SEARCH RESULT (Generalized)

This is the result when no parameter is specified. The result page


allows users to
• See the names of the files
65
Check Post Management System

• See the location of the files


• See the size of the files
• Copy the files

6.6 SEARCH RESULT (Size and Type Specified)

Our program has an option to specify the sizes of the files to be


searched as per their size (in KB) and their type (File Format).

66
Check Post Management System

67
Check Post Management System

68
Check Post Management System

CHAPTER 7
FUTURE SCOPE AND
CONCLUSION

69
Check Post Management System

7.1 FUTURE SCOPE


Future scope of Network based Search engine is wide as this
web application can be applied in various places where ever
Network based setup is present like office, other institutions
etc. In future it can be extended to develop web search
engine which can provide better search results, web search
engine which is domain specific like related to news, data
structures etc. It can be extended to develop web search
engine which provides students with the information about
different universities, college there ranks on different
parameters.

7.2 CONCLUSION

Generally all the Check Post has old and traditional method to
store data base like storing database in register. This way to
store database is not effectively utilized by user as they don’t
have a proper way to access this data. Currently the obstacle
is that user must know the exact location of the desired data.
So, we thought we can provide that interface to the user by
developing Check Post Management System. By using user
will be just a click away from what they want (adding new
information, updating added information, deleting unused
data related to vehicle, check post, users etc). User can
searched any type of information related with user, check
post, vehicle in a click .We have also provided authentication
as there may be some data which Transport administration
might not want to share with other users.

70
CHAPTER 8
BIBLIOGRAPHY

8.1 BIBLIOGRAPHY AND REFERENCES


• http://en.wikipedia.org/wiki/JavaServer_Pages
Check Post Management System

• http://www.ohio.edu/technology/training/upload/Java-Script-
Reference-Guide.pdf
• http://www.softwaretrainingtutorials.com/javajspservlets.php
• http://www.youtube.com/watch?v=dQ6gtaXQ0no
• http://www.youtube.com/watch?v=ujJ4H9RpC7c

72

Anda mungkin juga menyukai