network monitoring system project report

download network monitoring system project report

of 78

Transcript of network monitoring system project report

  • 8/11/2019 network monitoring system project report

    1/78

    It gives me pleasure to present my project report on Network Monitoring

    System as per requirement of the curriculum of the course Deploma of computer

    engineering from the msbte Mumbai at the government polytechnic jintur.

    First , I am hearty thankful to project guide Prof. A.K. Rathod sir forselecting

    this project.

    I would also like to thank Prof. B.M. Tachtode, .!.". of #.!. "e$t. and

    Princi$a% S.R. Th&te sir of our college.nce more we will e!press deepest thanks to our project guide Prof. A.K.

    Rathod sir for these guidance and "ncouragement at every step in our way completing

    this project.

    #astly we are heartly thankful to our parents and friends for their valuable support

    for our project.

    1

    . Prasad wadwalkar

    2. Sumit deshmane

    3. Amol rankhambe

  • 8/11/2019 network monitoring system project report

    2/78

    ABSTRA#T

    $etwork monitoring system supervises all computers in network. It consists of

    two programs client % server each run on different terminals which having different

    operating system that is platform independence like windows or #inu!. &erver program

    have task managerwhich shows process running on all clients. 'y using this task

    manager server can stop any process running on client terminal forcefully.

    It also ca$t&re remote deskto$ screenof client for observing whatever activity

    perform at that instant.

    It also provides chattingfacility between client and server. If client having any

    difficulty he can chat with server. (lient can ask question to server and server can reply.

  • 8/11/2019 network monitoring system project report

    3/78

    Table of Contents

    SR. N!. T!P'# PA() N!.

    * 'ntrod&ction

    ).) *roject *review

    ).+ &cope of *roject

    +*-

    *

    *

    - S&r/ey of 0iterat&re

    +.) &pecialty about emote -ask Manager

    +.).) ses of emote -ask Manager +.).+ /orking of emote -ask Manager

    +.+ &pecialty about &creen (apturing

    +.+.) /orking of &creen (apturing

    +.0 &pecialty about (hatting

    +.1 equirement 2nalysis

    +.3 &oftware equirement &pecification

    +1*-

    2

    3

    4

    4

    5

    6

    *7

    **

    1 "esign +*1-1

    2 'm$%ementation

    1.) #ogin /indow on &erver

    1.+ &erver side Interface

    +-217

    -2

    -3

  • 8/11/2019 network monitoring system project report

    4/78

    1.+.) emote -ask Manager

    1.+.+ &end Message

    1.+.0 "!ecute (ommand

    1.+.1 &creen (apturing Module

    1.+.3 (hatting Module

    1.+.4 #ock5nlock Module

    -4

    -5

    -5

    -8

    -6

    17

    3 Testing

    3.) -est )

    3.+ -est +

    3.0 -est 0

    3.1 -est 1

    3.3 -est 3

    3.4 -est 4

    +1*12

    1*

    1*

    1-

    11

    11

    12

    4 Res&%t 9 Ana%ysis 13

    5 A$$%ication 14

    8 :&t&re enhancement15

    6 #onc%&sion 18

    *7 Bi;%iogra$hy 16

  • 8/11/2019 network monitoring system project report

    5/78

    ** Pro

  • 8/11/2019 network monitoring system project report

    6/78

    2s the numbers of workstations are more in the network, it is the difficult task for

    the network administrator to off each and every workstation computer individually. -o

    simplify this in our project there is a provision for remote shutdown, reboot and logoff

    the workstation from the server. In addition to all this finally the report of login and

    logoff from particular workstation can be generated on server computer. -his project also

    provides file transfer.

    *.- Sco$e of Pro

    -here was no any computeri7ed based system e!isting to provide all function

    which we will provide in our proposed project. -he scope of project e!tends to the

    network related organi7ation that is connected by #2$.

    -hus this project can be used in wide application like &chools, ffices, (olleges,

    Institutions and (yber caf=

  • 8/11/2019 network monitoring system project report

    7/78

    #ha$ter -

    S=R)@ !: 0'T)RAT=R)

    emote -ask Manager from &mart#ine, Inc is a systems control interface that can

    be run from any remote /indows $-5+>>>5?* computer. It is the leading

    enterprise remote control solution for corporate networks.@)A

    emote -ask Manager significantly reduces the total cost of network management

    in enterprise environments by enabling I- personnel to control tasks, processes,

    services, devices, shared resources, events and computer performance over #2$,

    /2$ and the Internet.@)A

    -he periodic distribution of new programs, patches and updates represent a large

    portion of an administrator

  • 8/11/2019 network monitoring system project report

    8/78

    emote -ask Manager B-MC is a systems control interface that can be run

    from any remote /indows $-5+>>>5?* and /indows &erver +>>0 computer.

    -his enables a &ystems 2dministrator to control most aspects of a remote

    environment. -M adds the ability to lock5shutdown5reboot and to create

    processes on remote computers. @0A

    '' Flash'ack is a leading screen recording program for /indows, published by

    'lueberry &oftware. /hen the record function is activated, screen activity is

    stored in a real time video file. -his recording can then be replayed, edited and

    enhanced with graphics, te!t or sound effects. @1A

    &creen capturing is designed to meet the comple! requirements of technical and

    other workstation applications. It is designed for easy integration into

    applications. -he original colors of individual windows are preserved with any

    combination of windows. "ven when a window appears in false colors on the

    screen due to color table overrun, it is captured in its original colors and is saved

    correctly.@3A

    (hatting on #2$ approach enables cooperative work by using the #2$ as an

    entry point for starting applications that can offer more specific functionality for

    cooperative work.@4A

    -.* S$ecia%ty a;o&t Remote Task Manager

    2 clean and simple;to;use user interface offers easy setup wi7ards and multiple

    graphical views of the information. emote -ask Manager is designed to run

    under /indows $-5+>>>5?*. It provides automated support for Install and

    ninstall.

    emote -ask Manager even supports remote installs, enabling a &ystems

    2dministrator to set up a service on remote machines without ever having to

    physically go to them.

  • 8/11/2019 network monitoring system project report

    9/78

  • 8/11/2019 network monitoring system project report

    10/78

  • 8/11/2019 network monitoring system project report

    11/78

    -.- S$ecia%ty a;o&t Screen ca$t&ring

    Recording methodo%ogy

    /hereas other screen recorders are limited to a single capture technique, ''

    Flash'ack offers a choice of three different recording methods. -his includes the

    'lueberry capture driver, signed by Microsoft for /indows +>>> and ?* systems,

    representing the most advanced and high performance recording available to date.

    -he choice of recording methodologies means that, unlike our competitors, ''

    Flash'ack can give you the best recording whatever your material, computer and

    operating system.

    -he capture driver is signed by Microsoft for use on /indows ?* and +>>>

    operating systems. -his driver is not supported on /indows JK, Me and $-

    platforms ; but users of these operating systems will instead have a choice of the

    two alternative technologies below.

    "irect recording mode

    Direct? recording is an innovative recording technique that monitors different

    sections of the screen for changes. /hen a change in the screen is found, only the

    required section of the screen is analysed and stored to disk H meaning faster

    recording for the user without quality loss. -his recording method is preferable

    when recording on a when capturing special content such as Flash, e!tremely

    graphical material, or when using a lower speciation computer.

    ("' recording mode

    In 8DI mode the whole screen is captured in a series of frames then compared for

  • 8/11/2019 network monitoring system project report

    12/78

    differences. (hanges are stored to disk and compressed in a movie file. 8DI

    recording is preferable on higher specification machines with older operating

    systems, and offers reliable and quality recording.

    -.-.* ?orking of Screen ca$t&ring

    #a$t&re Modes>

    L ? "nhanced mode which e!ploits the full "asy(apture functionality. -his is the

    default mode.

    L ?/D mode which is based on the standard !wd program. For simple

    requirements this mode offers a faster alternative.

    L 8# mode BI'M &54>>> and &ilicon 8raphicsC may be required to capture

    windows created by 8#based or other non;? applications.

    #a$t&re Ty$es

    L 2 single window, with or without its frame,

    L -he full screen,

    L 2ny rectangular area of the screen

    #a$t&red 'mage :i%e

    "asy(apture saves the captured screen image in a file in ?/D format. -his file

    can be imported into other applications, or converted into other formats.

    #a$t&re !$tions

    ;beep true N false OIssue a beep before and after screen capture. -he default value is set in the

    initiali7ation fileC.

    ;display hostnameGserver.screen

  • 8/11/2019 network monitoring system project report

    13/78

    &pecifies the display on which the screen capture is to be performed. If the

    display is not specified, the DI&*#2 variable is used. If the DI&*#2 variable

    is not set, the local screen BhostnameG>.>C is the default display.

    ;application window;id

    &pecifies the window id of the main window of the calling application. -he

    window id is used if the application is to be hidden during screen capture. /hen

    this option is specified an output file name must also be specified.

    ;delay seconds

    -his enforces a time delay Bin secondsC when capturing. -he delay applies if the

    graphical user interface of the application overlaps the screen area to be captured,

    and it has been specified that this window is hidden during capture. ccasionally,

    the system

  • 8/11/2019 network monitoring system project report

    14/78

    -he domain name should be known to create chat id. ou can get it from your

    teacher. therwise, you can use the I* address of the computer in the place of

    domain name. *assword can be decided by you. ou can use your name itself at

    the user name. $ote that no two persons can have the same user name. For

    e!ample, If the domain name is myschool.edu, then your chat id will be in the

    form of Qmyname Pmyschool.edu

    Features are not available combinly.

    Features are platform dependent.

  • 8/11/2019 network monitoring system project report

    15/78

    Pro$osed System>

    -M, &creen (apturing and chatting features will be combined into one.

    *latform independency will be achieved.

    -.3 Software ReC&irement S$ecification

    2dministrator should be able to keep the track of all processes running on client.

    (lients may have different platform such as /indows, #I$? etc.

    (lient % &erver should be able to chat with each other in #2$.

    2dministrator should be able to kill the illegal processes of client.

    2dministrator should be able to keep an updated log file regarding recent

    activities of clients.

    ?ith RTM yo& can>

    Monitor all running tasks, processes, services and events on remote computers.

    /atch features of running tasks Bthe handle of the main window, process ID, etc.C.

  • 8/11/2019 network monitoring system project report

    16/78

    /atch features of running processes Bprocess ID, (* time, privileges used,

    memory and priorityC.

    &ee which process is associated with a selected task.

    &ee which process is associated with a selected service.

    "nd a selected task correctly.

    -erminate a selected process at any time.

    (hange priority of a selected process.

    (ontrol which (*s the process will be allowed to e!ecute on.

    &top, start, restart, pause and continue any selected service or device.

    (hange startup parameters of a service or a device Bname, account, startup type,

    dependencies, etc.C. (hange services repair parameters on /indows +>>>5?*.

    /atch dependent services.

    2djust services and devices security Bpermissions, auditing and ownerC.

    Manage shared resources on remote computers.

    (lear event logs.

    2rchive event logs.

    Monitor a dynamic overview of the computers performance B(* and memory

    usageC.

    &hut down and reboot remote computers.

    (reate processes on remote computers.

    #ock computers remotely.

  • 8/11/2019 network monitoring system project report

    17/78

    #ha$ter 1

    ")S'(N

  • 8/11/2019 network monitoring system project report

    18/78

    :ig1.*>=se #ase "iagram

    =S) #AS) "'A(RAM SP)#':'#AT'!N

    ). ($$"(-R-R&"E" G; It is used to connect client to the server after proper

    authentication of the client. 2uthentication is done by validating the user name

    and I* address of the client.

  • 8/11/2019 network monitoring system project report

    19/78

    +. M2$28"R"M-"R-2&SG emote task manager manages processes running

    on all clients. 'y using this task manager server can stop any process running on

    client terminal forcefully.

    0. (2*-"R&(""$&6-G It capture remote desktop screen of client for

    observing whatever activity perform at that instant.

    1. DoRchattingG It is used for administrator and clients for chatting with each other. It

    also used for chatting between client and client.

    3. 8"$"2-"R"*-G It is used for generate report which specifies time of the

    remote login, logoff, restart and shutdown.

  • 8/11/2019 network monitoring system project report

    20/78

    :ig1.->#%ass "iagram

  • 8/11/2019 network monitoring system project report

    21/78

  • 8/11/2019 network monitoring system project report

    22/78

    :ig1.2>State #hart "iagram

  • 8/11/2019 network monitoring system project report

    23/78

    :ig 1.3>SeC&ence "iagram :or Remote Task Manager

  • 8/11/2019 network monitoring system project report

    24/78

    :ig 1.4>SeC&ence "iagram :or #hatting

  • 8/11/2019 network monitoring system project report

    25/78

    :ig 1.5>SeC&ence "iagram :or Screen #a$t&ring

  • 8/11/2019 network monitoring system project report

    26/78

    :ig 1.8>#o%%a;oration diagram for remote task manager

  • 8/11/2019 network monitoring system project report

    27/78

    :ig 1.6>#o%%a;oration "iagram :or #hatting

  • 8/11/2019 network monitoring system project report

    28/78

    :ig 1.*7>#o%%a;oration "iagram :or Screen #a$t&ring

    #ha$ter 2

  • 8/11/2019 network monitoring system project report

    29/78

  • 8/11/2019 network monitoring system project report

    30/78

    2fter the administrator enters the valid username and password, he is granted access

    to the ne!t form. 'y clicking on the "!it button 2dministrator can close the application.

    -he above given window is basically used for authentication of administrator.Database of username and password is stored in oracle on &erver side.

    2.- Ser/er Side 'nterface

    -he server side interface act as a combined interface for all three modules i.e

    Remote Task Manager, Screen #a$t&ringand #hatting. -he right hand side of thewindow displays the operating system running at each and every client.

    -he number of clients connected is displayed with the corresponding name and ipaddress of the client. -he administrator can see the details of the client by clicking on the

    respective client

  • 8/11/2019 network monitoring system project report

    31/78

    2.-.* Remote Task Manager Mod&%e>

    -he Remote Task Manageris used to access the task manager of the client. -he

    name of the task running on the client

  • 8/11/2019 network monitoring system project report

    32/78

    to close the respective process. If the client fails to do so, the server can kill the process

    by clicking on the Sill *rocess button. 6ence, the client process is closed forcefully.

    2.-.- Send Message>

    'y clicking on send message button, the server can send any message to client.'y default e%%o Message is sent. &erver can also send any message to client.

    2.-.1 )Dec&te #ommand>

    -he e!ecute command button is used to e!ecute different commands at the client

    side by the server. For e!ample server can open note$ad.eDe, ms$aint.eDeor can evenshutdown the client terminal by sending the command Sh&tdowns.

  • 8/11/2019 network monitoring system project report

    33/78

    1.+.1 Screen #a$t&ring Mod&%e>

    &creen capturing module has two subparts. -hey are (et Screen and "ynamic

    #a$t&re.

    'y clicking on 8et &creen button, only static image of the client

  • 8/11/2019 network monitoring system project report

    34/78

  • 8/11/2019 network monitoring system project report

    35/78

    sing (hatting application, both client and server can chat between each other

    whenever required.

    2.-.4 0ockF=n%ock ?indow>

    -he %ockF&n%ockwindow is basically used by administrator while he5she leaves the

    terminal. -his window provides security by forcing the administrator to enter theusername and password again. 6ence, impersonisation can be avoided.

  • 8/11/2019 network monitoring system project report

    36/78

    #ha$ter 3

    T)ST'N(

    Test cases

    -est cases are designed such that all modules get tested at least by one of

    test cases. For successful testing all test cases should pass i.e. outcome should beas e!pected.

    3.)Test *

    Test -o test administrator login with correct ID % *assword.

    Test "escri$tion G -his testing is performed for the authentication

    of user.

    Phase G 2dministrator #ogin.

    Set&$ G2 unique ID and password are setup in the

    database itself.

    Testing G 6ere the administrator ID and *assword are checked.

    -he ID is also tested for different passwords and vice versa. 2n

    error message is displayed unless entered with correct specifiedID and password.

  • 8/11/2019 network monitoring system project report

    37/78

    Res&%t G Eerified ID and *assword.

    3.+Test -

    Test G-o test connection establishment.

    Test "escri$tion G -his test checks whether client is connected to

    server or not. 6ere the server should always be in listening mode.

    Phase G (lient;&erver connection establishment.

    Set&$ G2fter configuring $etwork adapter B"thernetCcard with proper I* address settings, the connectivityin computers in the #2$ are tested using *I$8

    command.

    Testing G "!ecute the server first and then specify the I*

    address5D$& name in the client side.

    -he states through which the module flowsG

    &"E"R#I&-"$I$8

    ;;2fter checking the server is listening, sending request for

    connection from client side.

    (#I"$-R($$"(-I$"T"&-

    ;;If the server is not listening, there will be no connection.

    ;;also if no I* address name is specified, there will be error

    message from client.

    (#I"$-R"M"&&28"

    ;;If everything is S, then connection will be successful

    (#I"$-R($$"(-"D

  • 8/11/2019 network monitoring system project report

    38/78

    Mod&%e Tested "stablishing connection between

    client and server.

    Res&%t G (onnection is established between client % server.

    3.1 Test 1

    Test -o test 8eneral tility tools.

    Test "escri$tion G -his test is performed to check the general

    utility tools like send message and e!ecute command.

    Phase G 8eneral tilities testing.

    Testing G #ets consider the e!ecute command tool. 2fter testing it

    for shutdown for windowsJK we came to a conclusion that the

    code needs some modifications for successful e!ecution onwindows ?* and higher versions.

    Res&%t G Modified as per requirements.

    3.2 Test 2

    Test G-est for (hat application.

    Test "escri$tion G -his test is performed to check the chat

    application between the client and server.

    Testing G 2fter initiating the chat application at client and serverside, it is checked that whether messages are passed correctly.

    Res&%t G (hat application was tested successfully.

  • 8/11/2019 network monitoring system project report

    39/78

    3.3 Test 3

    Test G-est for &creen (apturing.

    Test "escri$tion G -his test is performed to see if the server can

    capture the remote desktop screen without delay.

    Phase G -esting screen capturing.

    Testing G -he capturing and actually viewing the remote screen

    depends on the performance of the network B#2$C.

    Res&%t G &creen can be captured without any delay as well as it

    can be viewed in real;time.

    3.4 Test 4

    Test G-o test access of client

  • 8/11/2019 network monitoring system project report

    40/78

    #ha$ter 4

    R)S=0T AN" ANA0@S'S

    -esting has been performed for verification of user name and password,

    connection establishment, chatting application, remote task manager, screen capturing

    and general utility.

    In login form testing the administrator ID and *assword are checked. -he ID is

    also tested for different passwords and vice versa. 2n error message is displayed unless

    entered with correct specified ID and password. 2fter Eerifying ID and *assword he can

    get access to system.

    2fter configuring $etwork adapter B"thernetC card with proper I* address

    settings, the connectivity in computers in the #2$ are tested using *I$8 command .

    "!ecute the server first and then specify the I* address5D$& name in the client side. 2fter

    checking the server is listening, sending request for connection from client side and

    connection is established between server and client.

    2fter initiating the chat application at client and server side, it is checked that

    whether messages are passed correctly. If yes then (hat application was tested

    successfully.

  • 8/11/2019 network monitoring system project report

    41/78

    In emote task manager testing new process is made to e!ecute at client

  • 8/11/2019 network monitoring system project report

    42/78

    #ha$ter 8

    :=T=R) )NAN#)M)NTS

    *H Keystroke monitoring >

    In this the code can be further modified to capture the keystrokes of

    remote console. -his will help you in monitoring and preventing illegaluser operations.

    -H ?e;cam monitoring >

    /ebcam monitoring is useful tool in case of monitoring the users on the

    remote terminals or even for surveillance. It can also be successfully

    implemented for video conferencing.

    1H #ontro%%ing the Remote termina%s &sing Short Messaging Ser/ice ISMSH >

    sing mobile phone interaction with the computer, the application can be

    further enhanced. ne can emotely control some of the function such as

    S=T"!?N, R)START'N(the computer, killing the unnecessary tasks and

    even getting remote desktop screen on 8*& enabled phones. -he only necessity

    is that the remote computer should always be connected to the internet for &M&reception.

    2H Session #ontin&ation>

    -o make provision such that user session can be continued when the

    power failure problem occurs.

  • 8/11/2019 network monitoring system project report

    43/78

    #ha$ter 6

    #!N#0=S'!N

    &ecurity is an important aspect in the world of network. Earious businessorgani7ations are providing special attention for confidentiality in E*$

  • 8/11/2019 network monitoring system project report

    44/78

    #ha$ter *7

    B'B0'!(RAP@

    )C U)JJK;+>>+ &mart#ine, Inc.

    +C "asy emote *rogram Installations sing the -ask &cheduler &ervice, ev 1 ;

    2pril +V, +>>4, #ieberman &oftware (orporation httpG55www.liebsoft.com5

    0C (opyright U Device#ock, Inc. )JJV;+>>K.

    1C '' Flash'ack /hite *aper, )st "dition H '' Flash'ack ).1.) H February +>>3

    3C Implementation of &creen (apture in a Design "nvironment using "asy(apture,

    /hite *aper by Snud -homsen, Marketing Director.

    4C (hatting on the #2$byMartijn van /elie and 2nton "liWns Erije niversiteit,

    Department of Mathematics and (omputer &cience De 'oelelaan )>K), )>K) 6E

    2msterdam, -he $etherlands emailG martijn, eliensOPcs.vu.nl, fa!G

    X0).+>.111V430

    http://www.liebsoft.com/http://www.liebsoft.com/
  • 8/11/2019 network monitoring system project report

    45/78

    55PR!(RAMS AT S)R)R S'")JJ

    FF$rogram for %ogin for administrator for access who%e system

    FF0oginAdmin.

  • 8/11/2019 network monitoring system project report

    46/78

  • 8/11/2019 network monitoring system project report

    47/78

    int res\adminloginBj-e!tField).get-e!tBC,j*asswordField).get-e!tBCC9

    ifBres\\)C 55 if username % password is valid

    a)\new 2dmin8I)BC9 55 display server interface

    disposeBC9

    O else

    java!.swing.Zption*ane.showMessageDialogBthis,[Invalidser$ame5*assword[C9

    j-e!tField).set-e!tB[[C9 55clear both te!tfields and setfocus at particular

    te!tfield

    j*asswordField).set-e!tB[[C9 j-e!tField).requestFocusBC9

    O

    O

    else

    java!.swing.Zption*ane.showMessageDialogBthis,["nter *assword[C9j*asswordField).requestFocusBC9

    O

    O else

    java!.swing.Zption*ane.showMessageDialogBthis,["nter sername[C9

    j-e!tField).requestFocusBC9O

    O

    catchB"!ception eC

    java!.swing.Zption*ane.showMessageDialogBthis,[error is [XeC9

    OO55end of actionperformed

    private void init(omponentsBC

    55 design or declaration of variable for 8I

    j#abel) \ new java!.swing.Z#abelBC9 j-e!tField) \ new java!.swing.Z-e!tFieldBC9

    j#abel+ \ new java!.swing.Z#abelBC9

    j*asswordField) \ new java!.swing.Z*asswordFieldBC9 j'utton) \ new java!.swing.Z'uttonBC9

    j'utton+ \ new java!.swing.Z'uttonBC9

    j'utton).add2ction#istenerBthisC9 j'utton).set'ackgroundB(olor.dark8rayC9 55set dolor of button

    j'utton).setForegroundB(olor.whiteC9

    j'utton+.add2ction#istenerBthisC9

    j'utton+.set'ackgroundB(olor.dark8rayC9

  • 8/11/2019 network monitoring system project report

    48/78

    j'utton+.setForegroundB(olor.whiteC9

    add/indow#istenerB 55close all programs after disposing this window

    new /indow2dapterBC

    public void window(losingB/indow"vent weC

    disposeBC9

    O

    O C9

    get(ontent*aneBC.set#ayoutBnullC9 55define layout of content pane

    get(ontent*aneBC.set'ackgroundB(olor.orangeC9 55set color to content pane

    j#abel).set-e!tB[*assword[C9 55defines diff. labels j#abel).setFontBfC9

    get(ontent*aneBC.addBj#abel)C9

    j#abel).set'oundsB3>, V>, )>>, )1C9

    get(ontent*aneBC.addBj-e!tField)C9 j-e!tField).set'oundsB)4>, 0>, )+>, +>C9

    j-e!tField).setFontBfC9 j#abel+.set-e!tB[ser$ame[C9

    j#abel+.setFontBfC9

    get(ontent*aneBC.addBj#abel+C9 j#abel+.set'oundsB3>, 0>, )>>, )1C9

    get(ontent*aneBC.addBj*asswordField)C9

    j*asswordField).set'oundsB)4>, V>, )+>, +>C9 55set bound to pwd field

    j*asswordField).setFontBfC9 j'utton).set-e!tB[#ogin[C9

    j'utton).setFontBfC9

    get(ontent*aneBC.addBj'utton)C9 j'utton).set'oundsBK>, )3>, K>, +KC9 55set bound to login field

    j'utton+.set-e!tB["!it[C9

    j'utton+.setFontBfC9 get(ontent*aneBC.addBj'utton+C9

    j'utton+.set'oundsB)K>, )3>, J>, +KC9 55set bound to button

    set&i7eB03>,+3>C9

    O public static void mainB&tring args@AC

    55 beginning of program

    #ogin2dmin l)\new #ogin2dminBC9 55call constructor l).setEisibleBtrueC9

    O

    O

    FF $&;%ic interface for Adminser/er.

    Admin'nt*.

  • 8/11/2019 network monitoring system project report

    49/78

  • 8/11/2019 network monitoring system project report

    50/78

    O

    catchB"!ception eC 55catch e!ception.

    &ystem.out.printlnB[[XeC9

    O

    O public void accept(lientBjava.net.Inet2ddress iaCthrows emote"!ception

    clientEec.addBiaC9 552dd I* address of client in Eector O

    public Eector getser#istBC 55 eturn client list

    return clientEec9 55return vector containing list of clients.

    O

    public &tring getI*Bint inde!C 55 take I* address from clientEec vector

    Inet2ddress ia\BInet2ddressCclientEec.getBinde!C9

    return ia.get6ost2ddressBC9 O

    public void accepts$ameB&tring osnameCthrows emote"!ception 55accept &

    name

    clients.addBosnameC9 55add & name in client& vector

    O

    public Eector gets$ameBC 55take os name of client

    return clients9 55 return client os vector

    O public int loginB&tring user, &tring passwordCthrows emote"!ception

    55login function for chatting.It accept parameter username and pwd from client.

    int k\>9 55use for checking authentication or availability.

    ifBht.containsSeyBuserCC 55 check user already login or not

    return )9 55 if yes return )

    try

    &tatement st\cn.create&tatementBC9 55define variable for create statement

    esult&et rs\st.e!ecuteTueryB[&elect Y from login where uname\[XuserX[ andpwd\[XpasswordX[[C9 55check authontication for chating

    ifBrs.ne!tBCC 55 e!ecute query

    ht.putBuser,[welcome[C9 55put user % message in hash table

    v).addBuserC9 55add user in vector v)

    k\+9

    O

  • 8/11/2019 network monitoring system project report

    51/78

    rs.closeBC9 55close resourceset or statement.

    st.closeBC9

    O catchB&T#"!ception eC

    &ystem.out.printlnBeC9 O

    return k9 55return value of S for verification.

    Opublic void logoutB&tring userCthrows emote"!ception 55 logout client from

    chatting

    ht.removeBuserC9 55remove user from hash table v).removeBuserC9 55remove user from vector v)

    O

    public Eector get2llserBCthrows emote"!ception 55return client list of

    chatting .

    return v)9 55 return vector v) O

    public void sendMessageB&tring to,&tring msg Cthrows emote"!ception 55send msg to

    selected client

    &tring omsg\B&tringCht.getBtoC9

    ifBomsg\\nullC

    omsg\[[9 ht.putBto,omsgXmsgC9 55 add old message % new message

    O

    public &tring readMsgB&tring userCthrows emote"!ception 55 read msg

    &tring msg\B&tringCht.getBuserC9 55ckeck availability of user in hashtable.

    ht.putBuser,[[C9 return msg9 55return msg

    O

    public void send-o2llB&tring msg,&tring senderCthrows emote"!ception 55send msg to

    all client

    forBint i\>9i^v).si7eBC9iXXC 55send msg to all connected user.

    &tring user\B&tringCv).getBiC9 55select user.

    ifB_user.equalsBsenderCC 55 send msg to all clients e!cept him

    sendMessageBuser,msgC9 55send msg to user. O

    O

    public void runBC 55e!ecute this function at runtime i.e. run threads.

  • 8/11/2019 network monitoring system project report

    52/78

    whileBtrueC

    try

    forBint i \ >9 i ^ clientEec.si7eBC9 XXiC 55check whether client is shutdown or not

    55 check whether client is connected or not

    Inet2ddress ia \ BInet2ddressCclientEec.element2tBiC9 try

    &tring host \ ia.get6ost$ameBC9 55get host name of client Inet2ddress ia) \ Inet2ddress.get'y$ameBhostC955get Inetaddress of client

    using host name

    O

    catchB"!ception eC

    &ystem.out.printlnB[;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;[XeC9

    clientEec.removeBiaC9 55 remove client name after shutdown ordisconnected

    clients.remove"lement2tBiC9 55remove os name O

    O

    th.sleepB3>>>C9 5thread sleep after particular time interval O

    catchB"!ception eC

    &ystem.out.printlnBeC9 O

    O

    O

    55 Main (=' design of ser/er interface.

    FFAdmin(='*.

  • 8/11/2019 network monitoring system project report

    53/78

    boolean flag\true9

    Font f),f+,f09

    Z&croll*ane jsp,jsp)9 Z#ist lst\new Z#istBC9 55initiali7e the list

    Z*anel p0\new Z*anelBC9

    -hread th,thos,tclr9 55declare threads &tring cmd9

    Z#ist lst)\new Z#istBC9

    public 2dmin8I)BC 55(onstructor.

    setEisibleBtrueC9 55visbility of frame is set true

    set-itleB[&erver /indow[C9 55gives title to frame

    set&i7eB)1>>,VV3C9 55set si7e of frame set'ackgroundB(olor.cyanC9 55set background color.

    f)\new FontB[2rial[,),+>C9 55declare different fonts

    f+\new FontB[2rial[,),)4C9

    f0\new FontB[Einer 6and I-([,),+>C9 j#abel) \ new java!.swing.Z#abelBC9

    j#abel).setForegroundB(olor.whiteC9 55set color of label j#abel).set-e!tB[YY $"-/S M$I-I$8 &&-"M YY[C9

    j#abel).setFontBf)C9

    j#abel).set'oundsB+>>, )>>, +>>,)0>C9 set#ayoutBnew 'order#ayoutBCC9

    b)\new Z'uttonB[&ee Details[C9 55define buttons...

    b).add2ction#istenerBthisC9

    b).set'ackgroundB(olor.dark8rayC9 b).setForegroundB(olor.whiteC9

    b+\new Z'uttonB[&end Msg[C9

    b+.add2ction#istenerBthisC9 b+.set'ackgroundB(olor.dark8rayC9

    b+.setForegroundB(olor.whiteC9

    b0\new Z'uttonB["!ecute (ommand[C9 b0.add2ction#istenerBthisC9

    b0.set'ackgroundB(olor.dark8rayC9

    b0.setForegroundB(olor.whiteC9

    b1\new Z'uttonB[8et &creen[C9 b1.add2ction#istenerBthisC9

    b1.set'ackgroundB(olor.dark8rayC9

    b1.setForegroundB(olor.whiteC9 b3\new Z'uttonB[Dynamic (apture[C9

    b3.add2ction#istenerBthisC9

    b3.set'ackgroundB(olor.dark8rayC9 b3.setForegroundB(olor.whiteC9

    b4\new Z'uttonB[(hat[C9

    b4.add2ction#istenerBthisC9

    b4.set'ackgroundB(olor.dark8rayC9

  • 8/11/2019 network monitoring system project report

    54/78

    b4.setForegroundB(olor.whiteC9

    bV\new Z'uttonB[#ogoff[C9

    bV.add2ction#istenerBthisC9bV.set'ackgroundB(olor.dark8rayC9

    bV.setForegroundB(olor.whiteC9

    p0.addBj#abel)C9 55define panel addBp0,'order#ayout.&-6C9

    Z*anel p)\new Z*anelBC9

    p).addBb)C9 55add all buttons in panel ) p).addBb+C9

    p).addBb0C9

    p).addBb1C9

    p).addBb3C9 p).addBb4C9

    p).addBbVC9

    p).set'ackgroundB(olor.light8rayC9 55set panel color

    addBp),'order#ayout.$-6C9 55set location of panel setDefault(loseperationBjava!.swing./indow(onstants."?I-R$R(#&"C9

    55close all programs after closing..jsp\newZ&croll*aneBlst,&croll*ane(onstants.E"-I(2#R&(##'2R2&R$""D"D,

    &croll*ane(onstants.6I`$-2#R&(##'2R2&R$""D"DC9

    55define scrollpane for hoi7ontal % vertical scolling...addBjspC9

    try

    adminserver)\new 2dmin&erver)BC9 55create an object of server.$aming.rebindB[adminserver)[,adminserver)C9 55 bind name to adminserver)

    O

    catchB"!ception eC 55catch and display different errors..

    &ystem.out.printlnB[..................[XeC9

    O Z*anel p+\new Z*anelBC9

    p+.addBlst)C9

    p+.set'ackgroundB(olor.light8rayC9

    addBp+,'order#ayout."2&-C9 lst).set'ackgroundB(olor.light8rayC9

    th\new -hreadBthis,[-h-op#istf(lients[C9

    th.startBC9 55&-2- different threads.. thos \ new -hreadBthis,[os[C9 55assign names to threads..

    thos.startBC9

    tclr \ new -hreadBthis,[clr[C9 tclr.startBC9

    O

    public void runBC 55&tart -hreads.

  • 8/11/2019 network monitoring system project report

    55/78

  • 8/11/2019 network monitoring system project report

    56/78

    p0.set'ackgroundB(olor.magentaC9

    j#abel).setForegroundB(olor.blueC9

    j#abel).setFontBf)C9tclr.sleepB)>>>C9

    O

    catchB"!ception eC

    &ystem.out.printlnB[error is [XeC9

    O O

    O

    O 55eof runBC

    public void action*erformedB2ction"vent aeC 552fter (lick n 'uttons *articular2ction is taken.

    try

    int inde!\lst.get&electedInde!BC9 55select client

    ifBae.get&ourceBC\\b)C 558et -asklist of &elected (lient.

    ifBinde!]\>C

    -abDemo) tb\new -abDemo)Binde!,adminserver)C9 55display tasklist of client

    O

    return9

    O else

    ifBae.get&ourceBC\\b+C 55 &"$D M&8 - &"#"(-"D (#I"$-

    &tring cmd9

    ifBinde!]\>C

    cmd \ Zption*ane.showInputDialogB[msg[,[6ello[C9 55send [hello[ msg by

    default

    ifBcmd_\nullC

    ifBcmd.trimBC.lengthBC]>C 55check length of msg which server

    want to send to selected client.

    55 find obeject reference from rmiregistry (lientInt clientref\B(lientIntC$aming.lookupB[rmiG55[Xadminserver).getI*Binde!C

    X[5cs[C9

    clientref.adminMsgBcmdC9 55call adminmsg function at client side.. O

    O

    O

    O

  • 8/11/2019 network monitoring system project report

    57/78

    else

    ifBae.get&ourceBC\\b0C 55"?"(-" *2-I(#2 (MM2$D $

    &*"(IFI( (#I"$-.

    try

    ifBinde! ]\ >C

    cmd \ Zption*ane.showInputDialogB[enter the command[C955show input dialog bo! for e!ecuting command.

    ifBcmd_\nullC

    ifBcmd.trimBC.lengthBC]>C 55 find obeject reference from rmiregistry

    (lientInt clientref \

    B(lientIntC$aming.lookupB[rmiG55[Xadminserver).getI*Binde!CX[5cs[C9

    clientref.agg(ommandBcmdC9 O

    O O

    O

    catchB java.awt.6eadless"!ception eC

    e.print&tack-raceBC9 55print list of errors or stack of errors.

    O

    O else

    ifBae.get&ourceBC\\b1C 558et static Image of selected client.

    try

    ifBinde! ]\ >C

    byte b@A9

    (lientInt clientref \

    B(lientIntC$aming.lookupB[rmiG55[Xadminserver).getI*Binde!CX[5cs[C9 b \ clientref.get&creenBC9 55call get&creenBC function at client side.

    File file \ new FileB[screencapture.jpg[C9 55create file

    Fileutput&tream fout \ new Fileutput&treamBfileC9 fout.writeBbC9 55write in file

    fout.closeBC9 55close file

    ZFrame fr\ new ZFrameBC9 55create new frame Icon ia\ new ImageIconBbC9

    Z#abel l) \ new Z#abelBiaC9

    fr.set#ayoutBnew java.awt.'order#ayoutBCC9

    fr.set&i7eBV3>,4>>C9

  • 8/11/2019 network monitoring system project report

    58/78

    fr.set-itleB[&taicRImage[C9

    fr.setEisibleBtrueC9

    fr.addBl)C9 add/indow#istenerB

    new /indow2dapterBC 55close window...

    public void window(losingB/indow"vent weC

    disposeBC9 O

    O

    C9

    O O

    catchB"!ception eC

    &ystem.out.printlnB["rror is [XeC9

    e.print&tack-raceBC9 O

    O else

    ifBae.get&ourceBC\\b3C 55dynamic (apture f particular (lient.

    &tring name \ adminserver).getI*Binde!C9 55get I* of selected client

    new Dynamic&creen(aptureBnameC9

    55 call Dynamic&creenBC function for taking dynamic image of selected client.

    Oelse

    ifBae.get&ourceBC\\b4C 55#ogin window for chating.

    #oginForm l)\new #oginFormBC9 55display login form for authonticate for

    chatting

    l).setEisibleBtrueC9 O

    else

    ifBae.get&ourceBC\\bVC 55#ock server interface.

    setEisibleBfalseC9

    #ock/indow l+ \ new #ock/indowBthisC9

    55display login window after administrator would be logoff. l+.setEisibleBtrueC9

    O

    O catchB"!ception eC

    &ystem.out.printlnBeC9

    O

  • 8/11/2019 network monitoring system project report

    59/78

    O

    FF Program for %oginF&n%ock window after %ogoff.F%ock.

    FF0ock?indow.9

    try

  • 8/11/2019 network monitoring system project report

    60/78

  • 8/11/2019 network monitoring system project report

    61/78

    else

    java!.swing.Zption*ane.showMessageDialogBthis,["nter sername[C9 j-e!tField).requestFocusBC9

    O

    OcatchB"!ception eC

    java!.swing.Zption*ane.showMessageDialogBthis,[error is [XeC9O

    O55eof act

    private void init(omponentsBC

    j#abel) \ new java!.swing.Z#abelBC9

    j-e!tField) \ new java!.swing.Z-e!tFieldBC9 j#abel+ \ new java!.swing.Z#abelBC9

    j*asswordField) \ new java!.swing.Z*asswordFieldBC9 j'utton) \ new java!.swing.Z'uttonBC9

    j'utton).add2ction#istenerBthisC9

    j'utton).set'ackgroundB(olor.dark8rayC9 j'utton).setForegroundB(olor.whiteC9

    setDefault(loseperationBjava!.swing./indow(onstants."?I-R$R(#&"C9

    get(ontent*aneBC.set#ayoutBnullC9

    get(ontent*aneBC.set'ackgroundB(olor.orangeC9 j#abel).set-e!tB[*assword[C9

    j#abel).setFontBfC9

    get(ontent*aneBC.addBj#abel)C9 j#abel).set'oundsB3>, V>, )>>, )1C9

    get(ontent*aneBC.addBj-e!tField)C9

    j-e!tField).set'oundsB)4>, 0>, )+>, +>C9 j-e!tField).setFontBfC9

    j#abel+.set-e!tB[ser$ame[C9

    j#abel+.setFontBfC9

    get(ontent*aneBC.addBj#abel+C9 j#abel+.set'oundsB3>, 0>, )>>, )1C9

    get(ontent*aneBC.addBj*asswordField)C9

    j*asswordField).set'oundsB)4>, V>, )+>, +>C9 j*asswordField).setFontBfC9

    j'utton).set-e!tB[#ogin[C9

    get(ontent*aneBC.addBj'utton)C9 j'utton).set'oundsBJ3, )3>, J3, +KC9

    set&i7eB03>,+3>C9

    O

    O

  • 8/11/2019 network monitoring system project report

    62/78

  • 8/11/2019 network monitoring system project report

    63/78

    tab\new Z-ableBdata,headsC9 55create new table

    set#ayoutBnew 'order#ayoutBCC9 55set layout to table tab.set'ackgroundB(olor.pinkC9 55set background color of table

    tab.setFontBf+C9

    Z&croll*ane jsp\$ew&croll*aneBtab,&croll*ane(onstants.E"-I(2#R&(##'2R2&R$""D"D,&cr

    oll*ane(onstants.6I`$-2#R&(##'2R2&R$""D"DC9

    addBjspC9 b).add2ction#istenerBthisC9

    b).set'ackgroundB(olor.dark8rayC9

    b).setForegroundB(olor.whiteC9

    b+.add2ction#istenerBthisC9 b+.set'ackgroundB(olor.dark8rayC9

    b+.setForegroundB(olor.whiteC9

    Z*anel p)\new Z*anelBC9

    p).addBb)C9 p).addBb+C9

    p).set'ackgroundB(olor.light8rayC9 addBp),'order#ayout.$-6C9

    O

    catchB"!ception eC

    &ystem.out.printlnB["rror is [XeC9

    O

    tab.updateIBC9 55update table validateBC9 55validate table or frame

    update-able-hread\new -hreadBthisC9

    update-able-hread.startBC9 55start threadO

    public void runBC

    whileBtrueC

    try

    upDateDataIn-ableBC9 55update thread after perticulr period

    update-able-hread.sleepB0>Y)>>>C9

    O catchB"!ception eC

    &ystem.out.printlnB["rror in -abDemo) run [C9 O

    O

    O55end of run

  • 8/11/2019 network monitoring system project report

    64/78

    void upDateDataIn-ableBC throws I"!ception 55use for refresh table ater perticula

    period

    ifBdata.si7eBC]>C

    data.clearBC9 55clear data vector

    &tring'uffer sbr\clientref.get-asklistBC9 55 call tasklist command of clients 'ufferedeader br\new 'ufferedeaderBnew &tringeaderBsbr.to&tringBCCC9 55take

    list in buffer reader

    &tring str\[[9 whileBBstr\br.read#ineBCC_\nullC

    Eector vrow\new EectorBC9 &tring-okeni7er stk\new &tring-okeni7erBstrC9

    whileBstk.hasMore-okensBCC 55 token add in in vrow

    vrow.addBstk.ne!t-okenBCC9 55add fields token by token O

    data.addBvrowC9 O

    data.removeB>C9 55remove first row

    data.removeB>C9 tab.updateIBC9

    O

    public void action*erformedB2ction"vent aeC 55action performed after clicking on button

    try

    ifBae.get&ourceBC \\ b)C 55kill selected process of particular client

    ifBtab.get&electedowBC]>C

    int rowind\tab.get&electedowBC9

    &tring sel\B&tringCtab.getEalue2tBrowind,)C9

    Zption*ane.showMessageDialogBthis,selC9 clientref.kill*rocessBselC9 55 kill process of selected process id at client machine

    data.removeBrowindC9 55 remove process from list at server side

    tab.updateIBC9 55 update table which having tasklist Zption*ane.showMessageDialogBthis,[*rocess killed[C9

    O

    O

    ifBae.get&ourceBC\\b+C

  • 8/11/2019 network monitoring system project report

    65/78

    ifBtab.get&electedowBC]>C

    int rowind\tab.get&electedowBC9 &tring sel\B&tringCtab.getEalue2tBrowind,>C9

    &tring cmd \ sel X [G terminate the process[9

    clientref.adminMsgBcmdC9 55send msg to terminate theprocess

    O

    O O

    catchB"!ception eC

    Zption*ane.showMessageDialogBthis,["rror in -abDemo) is [XeC9 O

    O

    O

    FFProgram at c%ient sideJ

    FFRemote interface for c%ientser/er

    FF#%ient'nt.

  • 8/11/2019 network monitoring system project report

    66/78

    import java!.swing.Y9 55 import required packages

    import java.io.Y9import java.rmi.Y9

    import java.rmi.server.Y9

    import java.net.Y9import java.util.Y9 55 os name

    55for obot class

    import java.awt.2/-"!ception9import java.awt.obot9

    import java.awt.ectangle9

    import java.io.Y9

    import java.awt.-oolkit9import java.awt.image.'ufferedImage9

    import java!.imageio.ImageI9

    public class (lient&oft) e!tends nicastemotebject implements (lientInt

    public (lient&oft)BCthrows emote"!ception

    O

    public void kill*rocessB&tring pidCthrows emote"!ception 55Sillthe *rocess which server want.

    try

    untime r\untime.getuntimeBC9 55getruntime environment of client

    r.e!ecB[taskkill 5pid [XpidC9 55 e!ecute command of taskkill

    return9 O

    catchB"!ception eC

    &ystem.out.printlnB[error is [XeC9

    O

    O

    public void adminMsgB&tring msgCthrows emote"!ception 55getmsg which is send by admin.

    ifBmsg.equalsBnullCC 55if msg is null never print return9

    else

    new MessageBmsgC9 55 call Message function pass msg asparameter

    O

  • 8/11/2019 network monitoring system project report

    67/78

    9public &tring'uffer get-asklistBCthrows emote"!ception 55 get tasklist and

    return to &erver

    &tring'uffer sbr\new &tring'ufferBC9 55declare Qsbr< as string buffer

    try

    untime r)\untime.getuntimeBC9 55getruntime environment of client

    *rocess p)\r).e!ecB[-asklist[C955 e!ecute tasklist command

    Input&tream i)\ p).getInput&treamBC9 55take inputstream of processp) in i)

    'ufferedeader br\new 'ufferedeaderBnew Input&treameaderBi)CC9

    &tring str\[[9

    whileBBstr\br.read#ineBCC_\nullC 55read line of buffer reader br in str

    sbr.appendBstrX[n[C9 55 append sbr

    O

    br.closeBC9 55 close O

    catchB"!ception eC

    &ystem.out.printlnB[&ystem "rror G[XeC9

    O return sbr9 55return -asklist.

    O

    public void agg(ommandB&tring cmdCthrows emote"!ception 55e!ecute

    command which server want

    try

    ifBcmd.equalsBnullCC

    return9

    else

    untime r+ \ untime.getuntimeBC9 55getruntime environment of

    client

    *rocess p+ \ r+.e!ecBcmdC9 55 e!ecute commandO

    O

    catchB"!ception eC

    e.print&tack-raceBC9

    OO

    public byte@A get&creenBCthrows emote"!ception,2/-"!ception,I"!ception

    55return current static image to server

    try

  • 8/11/2019 network monitoring system project report

    68/78

    'ufferedImage screencapture \ new obotBC.create&creen(aptureBnewectangleB-oolkit.getDefault-oolkitBC.get&creen&i7eBCCC9

    55 strore image in 'ufferedImage screencapture by obot

    function File file \ new FileB[screencapture.jpg[C9 55create new file

    screencapture.jpg:

    ImageI.writeBscreencapture,[jpg[,fileC9 55write image inscreencapture.jpg file

    byte b@A \ new [email protected] 55 take file length in

    byte b

    FileInput&tream fin \ new FileInput&treamBfileC9 55take file inFileInput&tream fin

    fin.readBbC9 55read byte b in FileInput&tream fin

    fin.closeBC9 55 close

    return b9 O

    catchB"!ception eC

    e.print&tack-raceBC9

    O return null9

    O

    public static void main B&tring args@AC

    try

    (lient&oft) cs\new (lient&oft)BC9 55 add object in rmiregistry $aming.rebindB[cs[,csC9

    Inet2ddress ia\Inet2ddress.get#ocal6ostBC9 55 get ip address of localhost

    'ufferedeader br \ new 'ufferedeaderBnew FileeaderB[name.t!t[CC955 read hostname from name.t!t

    &tring name \ br.read#ineBC9

    2dminInt)

    adminint\B2dminInt)C$aming.lookupB[rmiG55[XnameX[5adminserver)[C955lookup server object in rmiregistry

    adminint.accept(lientBiaC9 55 return ip address to to server

    &ystem.out.printlnB[ok[C9 55after connecting to server print ok message *roperties p \ &ystem.get*ropertiesBC9 55get & name and return to server

    &tring os \ p.get*ropertyB[os.name[C9

    adminint.accepts$ameBosC9 55 return o& name to server O

    catchB"!ception eC

    &ystem.out.printlnB[error is [XeC9

  • 8/11/2019 network monitoring system project report

    69/78

  • 8/11/2019 network monitoring system project report

    70/78

  • 8/11/2019 network monitoring system project report

    71/78

    O

    catchB"!ception eC

    &ystem.out.printlnB[error in Dynamic (apture is [XeC9

    O

    OO

    FF $rogram of %ogin form for chatting

    0ogin:orm.

  • 8/11/2019 network monitoring system project report

    72/78

    java!.swing.Zption*ane.showMessageDialogBthis,["rror is [XeC9 55error display in

    joptionpane O

    O

    public void action*erformedBjava.awt.event.2ction"vent aeC 55 *erformed following action after pressing button

    try

    ifBae.get&ourceBC\\j'utton+C

    Zption*ane.showMessageDialogBthis,["!iting[C9

    disposeBC9 return9

    O

    ifBj-e!tField).get-e!tBC.trimBC.lengthBC]>C

    ifBj*asswordField).get-e!tBC.trimBC.lengthBC]>C

    int res\ref.loginBj-e!tField).get-e!tBC,j*asswordField).get-e!tBCC9

    ifBres\\+C

    new (hat/inBref,j-e!tField).get-e!tBCC9 55 display chatwindow

    disposeBC9

    O

    else ifBres\\>C

    java!.swing.Zption*ane.showMessageDialogBthis,[Invalidser$ame5*assword[C9

    j-e!tField).set-e!tB[[C9

    j*asswordField).set-e!tB[[C9 j-e!tField).requestFocusBC9

    O

    else

    ifBres\\)C

    java!.swing.Zption*ane.showMessageDialogBthis,[2lready #ogged

    Inn[C9 j-e!tField).set-e!tB[[C9

    j*asswordField).set-e!tB[[C9

    j-e!tField).requestFocusBC9 O

    O

    else

  • 8/11/2019 network monitoring system project report

    73/78

    java!.swing.Zption*ane.showMessageDialogBthis,["nter *assword[C9

    j*asswordField).requestFocusBC9

    O O

    else

    java!.swing.Zption*ane.showMessageDialogBthis,["nter sername[C9

    j-e!tField).requestFocusBC9

    OO

    catchB"!ception eC

    java!.swing.Zption*ane.showMessageDialogBthis,[error is [XeC9O

    O55eof act

    private void init(omponentsBC

    j#abel) \ new java!.swing.Z#abelBC9 j-e!tField) \ new java!.swing.Z-e!tFieldBC9

    j#abel+ \ new java!.swing.Z#abelBC9

    j*asswordField) \ new java!.swing.Z*asswordFieldBC9 j'utton) \ new java!.swing.Z'uttonBC9

    j'utton+ \ new java!.swing.Z'uttonBC9

    j'utton).add2ction#istenerBthisC9

    j'utton).set'ackgroundB(olor.dark8rayC9 j'utton).setForegroundB(olor.whiteC9

    j'utton+.add2ction#istenerBthisC9

    j'utton+.set'ackgroundB(olor.dark8rayC9 j'utton+.setForegroundB(olor.whiteC9

    add/indow#istenerB

    new /indow2dapterBC 55 close only window not all programafter click on e!it

    public void window(losingB/indow"vent weC

    disposeBC9

    O

    O C9

    get(ontent*aneBC.set#ayoutBnullC9

    get(ontent*aneBC.set'ackgroundB(olor.orangeC9 j#abel).set-e!tB[*assword[C9

    j#abel).setFontBfC9

    get(ontent*aneBC.addBj#abel)C9

    j#abel).set'oundsB3>, V>, )>>, )1C9

  • 8/11/2019 network monitoring system project report

    74/78

    get(ontent*aneBC.addBj-e!tField)C9

    j-e!tField).set'oundsB)4>, 0>, )+>, +>C9

    j-e!tField).setFontBfC9 j#abel+.set-e!tB[ser$ame[C9

    j#abel+.setFontBfC9

    get(ontent*aneBC.addBj#abel+C9 j#abel+.set'oundsB3>, 0>, )>>, )1C9

    get(ontent*aneBC.addBj*asswordField)C9

    j*asswordField).set'oundsB)4>, V>, )+>, +>C9j*asswordField).setFontBfC9

    j'utton).set-e!tB[#ogin[C9

    j'utton).setFontBfC9

    get(ontent*aneBC.addBj'utton)C9 j'utton).set'oundsBK>, )3>, K>, +KC9

    j'utton+.set-e!tB["!it[C9

    j'utton+.setFontBfC9

    get(ontent*aneBC.addBj'utton+C9 j'utton+.set'oundsB)K>, )3>, J>, +KC9

    set&i7eB03>,+3>C9 O

    public static void mainB&tring args@AC

    #oginForm l)\new #oginFormBC9

    l).setEisibleBtrueC9

    O

    O

    FF Program for dis$%aying message

    Message.

  • 8/11/2019 network monitoring system project report

    75/78

    catchB"!ception eC

    e.print&tack-raceBC9 55 display stack of errors O

    O

    O

    FF$rogram at ;oth ser/er and c%ient sideJ

    55Program for chatting

    #hat?in.

  • 8/11/2019 network monitoring system project report

    76/78

  • 8/11/2019 network monitoring system project report

    77/78

    &tring msg\ref.readMsgBuserC9 55read msg

    ifBmsg\\nullC

    msg\[[9 ifBmsg.lengthBC]>C 55 check msg length i.e. msg is written or not

    ta.appendBmsgX[n[C9 55print msg in te!tarea

    th+.sleepB3>>>C9 O

    add/indow#istenerB 55 after windows dispose stop all thread

    new /indow2dapterBC

    public void window(losingB/indow"vent weC

    try ref.logoutBuserC9 55call function logout

    th).stopBC9

    th+.stopBC9

    disposeBC9 O

    catchB"!ception eC

    &ystem.out.printlnB["[XeC9 55show errors

    O O

    O

    C9

    O catchB"!ception eC

    &ystem.out.printlnB["rror in run is [XeC9 55show error O

    O

    O public void action*erformedB2ction"vent aeC

    try

    ifBae.get&ourceBC\\b)C 55click for send msg

    ifBt).get-e!tBC.trimBC.lengthBC]>C

    ifBlst.get&electedInde!BC]\>C

    &tring to\B&tringCv).getBlst.get&electedInde!BCC9

    ref.sendMessageBto,t).get-e!tBCX[;;;[XuserC9 55 call function sendMessage

    Zption*ane.showMessageDialogBthis,[Msg &ent [C9 55display that Msg &ent:

    O

  • 8/11/2019 network monitoring system project report

    78/78

    O

    O

    else ifBae.get&ourceBC\\b+C 55click for send to all

    ifBt).get-e!tBC.trimBC.lengthBC]>C

    ref.send-o2llBt).get-e!tBCX[;;;[Xuser,userC9 55 call function send-o2ll

    Zption*ane.showMessageDialogBthis,[Msgs &ent [C9 O

    O

    else

    ifBae.get&ourceBC\\b0C 55click for logout

    ref.logoutBuserC9 55call function logout

    th).stopBC9 55 stop thread

    th+.stopBC9 55 stop thread disposeBC9 55 dispose windows

    O O

    catchB"!ception eC

    55 show errors Zption*ane.showMessageDialogBthis,["rror is [XeC9

    O

    O

    O

    Thank You