Senthil Documentation
-
Upload
senthilkumaran -
Category
Documents
-
view
240 -
download
0
Transcript of Senthil Documentation
-
8/8/2019 Senthil Documentation
1/73
`
A STUDY ON THE REMOTE SYSTEM MONITERING THROUGHA STUDY ON THE REMOTE SYSTEM MONITERING THROUGH
WIN-32 APIWIN-32 API
A Project Report submitted to the
Bharathidasan University, Tiruchirappalli
In partial fulfilment of the requirements for the award of the degree of
MASTER OF BUSINESS ADMINISTRATION
Submitted By
SENTHILKUMARAN.K
(REG.NO-09296504)
Under the guidance of
MR.M.GOVINDARAJ ,Msc, M.Phil.,M.Tech.
Department of Computer Science & Applications,
Bharathidasan University,
Tiruchirapalli 620 024.
CENTER FOR DISTANCE EDUCATIONBHARATHIDASAN UNIVERSITY
TIRUCHIRAPPALLI-620024
AUGUST 2010
1
-
8/8/2019 Senthil Documentation
2/73
`
CENTRE FOR DISTANCE EDUCATION
BHARATHIDASAN UNIVERSITY
TIRUCHIRAPPALLI -24
CERTIFICATE
This is to certify that the dissertation entitled REMOTE SYSTEM MONITERING
THROUGH WIN 32 API is the bonafide work done under my supervision by
SENTHILKUMARAN.K(Reg No : 09296504) and submitted to Bharathidasan University
Tiruchirapalli in partial fulfillment of the requirements for the award of the degree of Master of
Business Administration during the academic year(2009-2010)
Signature of the Co-ordinator Signature of the Guide
Dr.S.Sekar Dr.M.Govindaraj
The viva voice examination held was conducted on __________________at the
Bharathidasan University,Tiruchirappalli-620 024.
Internal Examiner External Examiner
2
-
8/8/2019 Senthil Documentation
3/73
`
MR.M.GOVINDARAJ ,Msc, M.Phil.,M.Tech.
Lecturer,
Department of Computer Science & Applications,Bharathidasan University,
Tiruchirapalli 620 024.
Date:
BONAFIDE CERTIFICATE
This is to certify that the dissertation entitled REMOTE
SYSTEMMONITERING THROUGH WIN 32 API is the bonafide work done under my
supervision by SENTHILKUMARAN.K(Reg No : 09296504) and submitted to Bharathidasan
University Tiruchirapalli in partial fulfillment of the requirements for the award of the degree of
Master of Business Administration during the academic year(2009-2010)
Signature of the Guide
3
-
8/8/2019 Senthil Documentation
4/73
`
As the requirements needed to complete the Microsoft certificate has been
under gone by me which gained me the Microsoft certificate and awarded by the
Microsoft -MCITP PROFESSIONAL CERTIFICATION. This certification and the
guidance from the HCl has made me to develop this project successfully.
4
-
8/8/2019 Senthil Documentation
5/73
`
DECLARATION
I hereby declare that the work presented REMOTE SYSTEM MONITERING
THROUGH WIN 32 API in this dissertation is the original work done by me under
the guidance ofMr. M.GOVINDARAJ Msc,M.Phil.,M.Tech.., Lecturer, Department of
Computer Science and Applications, Bharathidasan University, Tiruchirappalli-24and has not
been included in any thesis/dissertation submitted for any other degree.
Name of the Candidate : SENTHILKUMARAN.K
Register Number : 09296504
Academic Year : 2009 2010
Signature of the Candidate
5
-
8/8/2019 Senthil Documentation
6/73
`
ACKNOWLEDGEMENT
6
-
8/8/2019 Senthil Documentation
7/73
`
I would like to thank my Father KULASEKAR.S and my Mother PUSPHALATHA.Kfor
giving me this ample opportunity to do this course and their kind, care and guidance.
I am thankful to Dr. N.ARUMUGAM M.Com.,M.Phil.,Ph.D., DIRECTOR, CENTER FOR
DISTANCE EDUCATION, BHARATHIDASAN UNIVERSITY, TIRUCHIRAPALLI 620 023, for
his academic support to carry out his project.
I would like to thankDr.S. SEKAR, M.Com.,M.B.A.,M.Phil.,Ph.D.,CO-ORDINATOR, MBA
CONCURRENT COURSE AT URUMU DHANALAKSHMI COLLEGE CENTER for his timely
suggestions and permission to do this project.
I wish to express my profound sense of gratitude to my Project Guide
Mr.M.GOVINDARAJ, Msc,M.Phil.,M.Tech.,for her help, valuable and kind guidance and personal
interest shown throughout my Project Work
I also express my sincere thanks to HCL Infotech Chennai for giving me an opportunity to do
the project and for his valuable guidance throughout my project work.
Finally I thank all faculty members in Department of Management, UDC of Arts and Science, My
Parents, My Family Members and My Friends who have directly or indirectly helped me to successfully
complete this project.
SYNOPSIS
The Project Entitled Window Management Instrumentation aims at monitoring the remote
machine information in a interconnected environment. The development process includes the
design of control library named as WMIControlLibrary which contains four user controls. The
7
-
8/8/2019 Senthil Documentation
8/73
`
four user controls are as follows: Explorer, SystemInfo, Services, and Processes. Each one of
these controls does its own specific task. Brief description of what each one of these control
does.
Explorer Control - we converted 'My Explorer' to a user control, it still display your
system drives, directories, and files information.
SystemInfo Control* - This control display operating system information and hardware
data and specifications.
Services Control* - This control display services currently running on the system.
Process Control* - This control display processes currently running on the system.
(* Note: This control can be used to monitor local or remote system on the network.)
Every one of these controls uses the System.Management namespace to access their own specific
system information.
Development Tool : VC#.NET
Integerated Development Environment : Visual Studio IDE 2005
8
-
8/8/2019 Senthil Documentation
9/73
`
CONTENTS
9
-
8/8/2019 Senthil Documentation
10/73
`
10
1.0 PROJECT DESCRIPTION 14
1.1 INTRODUCTION 14
1.2 EXISTING SYSTEM 14
1.3 PROPOSED SYSTEM 14
1.4 WIN-32 API 15
1.5 MODULES IN DETAIL 151.5.1 EXPLORER CONTROLS 16
1.5.2 SYSTEM INFO CONTROLS 17
1.5.3 SERVICE CONTROLS 18
1.5.4 PROCESS CONTROLS 19
1.6 HARDWARE SPECIFICATION 21
1.7 SOFTWARE SPECIFICATION 21
2.0 SOFTWARE DESCRIPTION 22
2.1 VISUAL BASIC .NET 22
2.1.1 POWERFUL WINDOWS BASED
APPLICATION22
2.1.2 BULIDING WEB-BASED
APPLICATION22
2.1.3 SIMPLIFIED DEVELOPMENT 23
2.2 POWERFUL , FEEXIABLE ,
SIMPLIFIED DATA ACCESS23
2.2.1 IMPROVED CODING 23
2.2.2 DIRECT ACCESS TO PLATFORM 23
2.2.3 FULL OBJECT ORIENTED
CONTROLS23
2.3 XML WEB SERVICES 242.3.1 MOBLIE APPLICATION 24
2.3.2 COM INTEROPERABILITY 24
2.3.3 REUSE EXISTING INVESTMENT 25
2.3.4 UPGRADE WIZARD 25
3.0 TESTING
TESTING OBJECTIVE 27
-
8/8/2019 Senthil Documentation
11/73
`
11
-
8/8/2019 Senthil Documentation
12/73
`
1.0 PROJECT DESCRIPTION
1.1 INTRODUCTION
Remote Desktop Connection (RDC, also called Remote Desktop, formerly known
as Microsoft Terminal Service Client, or mstsc) is the client application for Remote Desktop
Services. It allows a user to remotely log in to a networked computer running the terminal
services server. RDC presents the desktop interface of the remote system, as if it were
accessed locally The server should have the ability to minimize ,maximize or close those
applications on the client's desktop.
It should not follow RDP protocol or remote desktop protocol in windows xp
protocol.But it should be running in windows xp environment.
Both the systems should be working simultaneously and there should be no user
name and password conventions in this application.The application should simply work based
on the IP address and port number.
12
-
8/8/2019 Senthil Documentation
13/73
`
1.2 EXISTING SYSTEM:
The current system of WMI provided by the Microsoft will display the contents such as
processes, services and system information of the current machine. In the client server
environment the server can monitor the remote machine information such as system info,
processes and service, but the two different clients in the network cannot view the information of
one client from the other. In order to overcome this problem, a proposed system is devised based
on the functionality of the existing system. The proposed system is explained in the next section.
1.3 PROPOSED SYSTEM:
The proposed system is devised in order to overcome the defects of the existing system. In
the proposed system. The clients in the interconnected environment can view the information of
another client in the interconnected system. This functionality is made possible as follows, any
machine in the windows platform will have the default control named WMI, which is responsible
for fetching the computers information, thus the remote machine in the network also have the
WMI, thus we can call the remote machines WMI through the SNMP protocol, by doing so the
information of the remote client in the network can be accessed by another client.
Client A Client C
1.4 WIN-32 API
Win32 requires a good level of understanding and work, Microsoft released a
customized version of the Win32 library to make it easier to comprehend. The library is called
Microsoft Foundation Class Library (MFC). Because Win32 was written in C and MFC was
written for C/C++ developers, programmers of other languages would not understand it. To
accommodate others, in fact to make Windows programming accessible to everybody, Microsoft
13
-
8/8/2019 Senthil Documentation
14/73
`
created Microsoft Visual Basic as a true graphical programming environment. Visual Basic used
a different and simpler language, called Basic as its foundation.
1.5 Modules in Detail
In this project I have created a WMIControlLibrary which contains four user controls. The
four user controls are as follows: Explorer, SystemInfo, Services, and Processes. Each one of
these controls does its own specific task. Here is a brief description of what each one of these
control does.
Explorer Control - I converted 'My Explorer' to a user control, it still display your system
drives, directories, and files information.
SystemInfo Control* - This control display operating system information and hardware
data and specifications.
Services Control* - This control display services currently running on the system.
Process Control* - This control display processes currently running on the system. (*
Note: This control can be used to monitor local or remote system on the network.)
Every one of these controls uses the System.Management namespace to access their own specific
system information.
14
-
8/8/2019 Senthil Documentation
15/73
`
1.5.1 Explorer Control
In the Explorer control, I used the WMI Win32_LogicalDisk class to get all the local and
mapped drives on the local machine. To get access to drives information, I need to use the
ManagementObjectSearcher class to obtain a ManagementOjbectCollection class containing the
drive information.
I requested. We now have all the available drives' information at our disposal (such as drive
name, type, volume, description, etc...).
Unfortunately, it proved almost impossible to find any references to the interfaces
necessary to do the job.
15
-
8/8/2019 Senthil Documentation
16/73
`
1.5.2 SystemInfo Control
The SystemInfo control display many different types of information about your local machine or
a remote machine on the network. It first establishes a ConnectionOptions object with the
UserName and Password properties set. Then it creates a ManagementScope object with the
local or remote host name and the ConnectionOptions object as the parameters.
Now we are ready to access the system information by creating an ObjectQuery member object
and passing it along with the ManagementScope object in to the ManagementObjectSearcher
member object and invoke the Get() method to execute the command.
If you are only concerned about the local host information, you can avoid the creation of
ConnectionOption, ManagementScope, and ObjectQuery objects. All you need to do is just call
the ManagementObjectSearcher member object with the query string and execute the
ManagementObjectSearcher.Get() method to get the ManagementObjectCollection result back,
for the local machine.
16
-
8/8/2019 Senthil Documentation
17/73
`
The SystemInfo control also displays the following information about the computer system being
accessed: System Manufacturer, Processor, Bios, Time Zone, Memory, Network Connection,
and Video Controller. The codes for these different queries are repetitive, it's just the query string
and the result properties are different.
1.5.3 Service Control
The Service control uses the query:
SELECT * FROM Win32_Service
to retrieve all the services information in the system. To start or stop a service, I dynamically
create a popup menu to the ListView.
When you right click on an item, a start or stop menu pops up, depending on the service state.
When the MenuItem is clicked, I need to get the ManagementObject for that service with this
query.
17
-
8/8/2019 Senthil Documentation
18/73
`
SELECT * FROM Win32_Service WHERE Name = 'ServiceName'.
Then I call the ManagementObject.InvokeMethod() to start or stop the service. The first
parameter in the InvokeMethod method is the Observer parameter. I pass in a
ManagementOperationObserver class to manage asynchronous operations and handlemanagement information and events received asynchronously. By checking the returnValue
property in completionHandlerObj.ReturnObject, I can determine if the operation was successful
or not.
1.5.4 Process Control
The Process control display the system running processes, user that started the process, CPU
utilization, and memory usage.
To get the process user, I need to call the GetOwner(User, Domain) method. The User and
Domain parameters are output parameters. How do we get to these output parameters from
InvokeMethod.
18
-
8/8/2019 Senthil Documentation
19/73
`
This depends on how we implement the InvokeMethod. If we do not need to manage
asynchronous operations, then we need to pass in a string[] to the InvokeMethod method to
retrieve the output parameters.
But if we need to manage asynchronous operations, then we do not need to pass in any
parameters to InvokeMethod method. You will get the output parameters from the
completionHandlerObj.ReturnObject properties collection.
19
-
8/8/2019 Senthil Documentation
20/73
`
1.6 HARDWARE SPECIFICATION:
PROCESSOR -- PENTIUM 111
SPEED -- 700 MHZ
MAIN MEMORY -- 256 MB
KEY BOARD -- RITCOMP 2098- CHERRY SOFT
MOUSE -- LOGITECH
MONITOR -- SAMTEL COLOR MONITOR
HARDDISK -- 10 GB
FLOPPY DRIVE -- 1.44 MB
CD DRIVE -- 50X MAX
1.7 SOFTWARE SPECIFICATION:
FRONT END TOOLS :VC#.NET
OPERATING SYSTEM : WINDOWS XP
20
-
8/8/2019 Senthil Documentation
21/73
`
2.0 SOFTWARE DESCRIPTION
2.1 Visual Basic .NET
Visual Basic .NET provides the easiest, most productive language and tool
for rapidly building Windows and Web applications. Visual Basic .NET comes with enhanced
visual designers, increased application performance, and a powerful integrated development
environment (IDE). It also supports creation of applications forwireless, Internet-enabled hand-
held devices. The following are the features of Visual Basic .NET with .NET Framework 1.0 and
Visual Basic .NET 2003 with .NET Framework 1.1. This also answers why should I use Visual
Basic .NET, what can I do with it?
2.1.1 Powerful Windows-based Applications
Visual Basic .NET comes with features such as a powerful new forms designer, an
in-place menu editor, and automatic control anchoring and docking. Visual Basic .NET delivers
new productivity features for building more robust applications easily and quickly. With an
improved integrated development environment (IDE) and a significantly reduced startup time,
Visual Basic .NET offers fast, automatic formatting of code as you type, improved IntelliSense,
an enhanced object browser and XML designer, and much more.
2.1.2 Building Web-based Applications
With Visual Basic .NET we can create Web applications using the shared Web Forms
Designer and the familiar "drag and drop" feature. You can double-click and write code torespond to events. Visual Basic .NET 2003 comes with an enhanced HTML Editor for working
with complex Web pages. We can also use IntelliSense technology and tag completion, or
choose the WYSIWYG editor for visual authoring of interactive Web applications.
21
http://www.startvbdotnet.com/dotnet/vbnet.aspxhttp://www.startvbdotnet.com/dotnet/vbnet.aspxhttp://www.startvbdotnet.com/dotnet/vbnet.aspxhttp://www.startvbdotnet.com/dotnet/vbnet.aspxhttp://www.startvbdotnet.com/dotnet/vbnet.aspxhttp://www.startvbdotnet.com/dotnet/vbnet.aspxhttp://www.startvbdotnet.com/dotnet/vbnet.aspxhttp://www.startvbdotnet.com/dotnet/vbnet.aspxhttp://www.startvbdotnet.com/dotnet/vbnet.aspxhttp://www.startvbdotnet.com/dotnet/vbnet.aspxhttp://www.startvbdotnet.com/dotnet/vbnet.aspxhttp://www.startvbdotnet.com/dotnet/vbnet.aspxhttp://www.startvbdotnet.com/dotnet/vbnet.aspx -
8/8/2019 Senthil Documentation
22/73
`
2.1.3 Simplified Deployment
With Visual Basic .NET we can build applications more rapidly and deploy and
maintain them with efficiency. Visual Basic .NET 2003 and .NET Framework 1.1 makes "DLL
Hell" a thing of the past. Side-by-side versioning enables multiple versions of the same
component to live safely on the same machine so that applications can use a specific version of a
component. XCOPY-deployment and Web auto-download of Windows-based applications
combine the simplicity of Web page deployment and maintenance with the power of rich,
responsive Windows-based applications.
2.2 Powerful, Flexible, Simplified Data Access
You can tackle any data access scenario easily with ADO.NET and ADO data
access. The flexibility of ADO.NET enables data binding to any database, as well as classes,
collections, and arrays, and provides true XML representation of data. Seamless access to ADO
enables simple data access for connected data binding scenarios. Using ADO.NET, Visual
Basic .NET can gain high-speed access to MS SQL Server, Oracle, DB2, Microsoft Access, and
more.
2.2.1 Improved Coding
You can code faster and more effectively. A multitude of enhancements to the
code editor, including enhanced IntelliSense, smart listing of code for greater readability and a
background compiler for real-time notification of syntax errors transforms into a rapid
application development (RAD) coding machine.
2.2.2 Direct Access to the Platform
Visual Basic developers can have full access to the capabilities available in
.NET Framework 1.1. Developers can easily program system services including the event log,
performance counters and file system. The new Windows Service project template enables to
build real Microsoft Windows NT Services.
22
http://www.startvbdotnet.com/dotnet/vbnet.aspxhttp://www.startvbdotnet.com/dotnet/vbnet.aspx -
8/8/2019 Senthil Documentation
23/73
`
Programming against Windows Services and creating new Windows Services is not available in
Visual Basic .NET Standard, it requires Visual Studio 2003 Professional, or higher.
2.2.3 Full Object-Oriented Constructs
You can create reusable, enterprise-class code using full object-oriented
constructs. Language features include full implementation inheritance, encapsulation, and
polymorphism. Structured exception handling provides a global error handler and eliminates
spaghetti code.
2.3 XML Web Services
XML Web services enable you to call components running on any platform
using open Internet protocols. Working with XML Web services is easier where enhancements
simplify the discovery and consumption of XML Web services that are located within any
firewall. XML Web services can be built as easily as you would build any class in Visual Basic
6.0. The XML Web service project template builds all underlying Web serviceinfrastructure.
2.3.1 Mobile Applications
Visual Basic .NET 2003 and the .NET Framework 1.1 offer integrated support
for developing mobile Web applications for more than 200 Internet-enabled mobile devices.
These new features give developers a single, mobile Web interface and programming model to
support a broad range of Web devices, including WML 1.1 for WAPenabled cellular phones,
compact HTML (cHTML) for i-Mode phones, and HTML for Pocket PC, handheld devices, and
pagers. Please note, Pocket PC programming is not available in Visual Basic .NET Standard, it
requires Visual Studio 2003 Professional, or higher.
2.3.2 COM Interoperability
You can maintain your existing code without the need to recode. COM
interoperability enables you to leverage your existing code assets and offers seamless bi-
directional communication between Visual Basic 6.0 and Visual Basic .NET applications.
23
http://www.startvbdotnet.com/dotnet/vbnet.aspxhttp://www.startvbdotnet.com/dotnet/vbnet.aspxhttp://www.startvbdotnet.com/dotnet/vbnet.aspx -
8/8/2019 Senthil Documentation
24/73
`
2.3.3 Reuse Existing Investments
You can reuse all your existing ActiveX Controls. Windows Forms in Visual
Basic .NET 2003 provide a robust container for existing ActiveX controls.
In addition, full support for existing ADO code and data binding enable a smooth transition to
Visual Basic .NET 2003.
2.3.4 Upgrade Wizard
You upgrade your code to receive all of the benefits of Visual Basic .NET 2003. The Visual
Basic .NET Upgrade Wizard, available in Visual Basic .NET 2003 Standard Edition, and higher,
upgrades up to 95 percent of existing Visual Basic code and forms to Visual Basic .NET with
new support for Web classes and User Controls.
24
-
8/8/2019 Senthil Documentation
25/73
`
25
-
8/8/2019 Senthil Documentation
26/73
`
3.0 TESTING OBJECTIVES
Testing is a process of executing a program with an intense of finding an error. A
test is on that has a high probability or finding an undiscovered errors. A successful test is
that uncovers an undiscovered errors.
3.1 TYPE OF TESTING DONE:
As per seven laws of computing Any non-trivial program contains at least one
bug. These are no trivial programs. The proper choice of test data is an important as the
test itself so; live data has been collected for testing.
3.1.1 UNIT TESTING:
The modules of the system are tested as an individual in unit testing; each unit has
definite input and output parameters.
3.1.2 INTEGRATION TESTING:
In the system testing, the system is tested as a whole intercommunication, among
the individual units and functions of the complete system are tested.
3.1.3 SYSTEM TESTING:
In the system testing, the system is tested as a whole intercommunication, among
the individual units and functions of the complete system are tested.
3.1.4 DESTRUCTION TESTING:
In this type of testing, the application is tested until it does something. A is not
suppose to do.
3.1.5 WINDOWS DESIGNING TEST:
This test provides, that each individual window (print, record, menus, message box) that
the system consists of has been designed and built according to project standards.
26
-
8/8/2019 Senthil Documentation
27/73
`
3.1.6 FUNCTION TESTING:
This testing method ensures that the nuts and bolts functions of the system are
actually tested.
3.1.7 INTEGRATION TESTING:
The aim of the integration test is to put together the individually unit tested pages
and build program structure; while at the some time tests are conducted to uncover errors
associated with interfacing of pages.
In this test this program goes smoothly from starting end. If we give any wrong
input it display error message immediately. Display output are tested and verified.
3.1.8 PERFORMANCE TESTING:
This determines the length of time by the system to process transaction of data.
For ex, the response times in case of an inquiry of the system
Implementation is the stage where the theoretical is converted into a working
system. This is the processing converting a new or a revised system into an operational
one of the implementation consists of
Testing the developed system with sampled data.
Detection and correction of errors.
Making necessary charges in the system.
Checking of reports with that of the existing system.
Training of software and hardware utilities.
Installation of software and hardware utilities
27
-
8/8/2019 Senthil Documentation
28/73
`
28
-
8/8/2019 Senthil Documentation
29/73
`
4.0 IMPLEMENTATION ON CLIENT MACHINE(Graphically)
4.1 User Password
In order for remote desktop to work, you have to set a password on your user account. Follow
these steps to set a password.
1. Go to Start then to My Computer (or go to your desktop and go to My Computer)
2. Go to Control Panel
3. Go to User Accounts
4. Click on your user account
5. Go to Create a Password
6. Fill everything out and hit Create Password
4.2 Enabling Remote Desktop Connection (on the host)
Now youre ready to enable remote desktop. You have to be logged in as an administrator
1. Go to Start then right click on My Computer (or right click My Computer on your
desktop)
29
-
8/8/2019 Senthil Documentation
30/73
`
2. Select Properties
3. Go to the Remote tab
4. Check Allow users to connect remotely to this computer
5. If you have other users that you want to allow remote access to the computer then go to
Select Remote Users and select add and type in the user account name of the user where
it says Enter the object names to select
4.3 Getting your IP address
You now have to get your ip address.
4.3.1 Connecting to the host machine from another machine
Now, this is how to connect to your computer from using Remote Desktop Connection. If youre
using a computer that doesnt have Windows XP then you can load the client side of Remote
Desktop Connection. Get it at and then you can follow these steps.
1. Go to Start
2. Go to All Programs
3. Go to Accessories
4. Go to Communications
5. Click Remote Desktop Connection
6. Go to Options and modify the options as you seem fit
7. Type in your IP address by 'Computer'
8. Log in with your username and password
You should now have access to your computer. Take note that playing music will not work well
with over the remote connection unless you have it stay at the local computer (change this in the
options). Also, if you view images and webpages over the connection it will be very slow. Oh,
and of course, you cant play games like Quake 3 over the connection, this simply isnt possible.
You can access your documents from anywhere.
30
-
8/8/2019 Senthil Documentation
31/73
`
You can keep your IRC (internet relay chat) and IM clients open on one machine and
then connect to your computer from other places. Thus you dont have to leave your
screen names and whatnot behind on other peoples computers.
Check and save email in YOUR email client instead of using webmail.
Perhaps your workplace/school doesnt allow you to run IRC or IM clients, but you can
use remote desktop. Then you can log on to your computer and IRC and IM from there.
You could use this as some sort of tech support method.
You can use Remote Desktop if you cant always have a monitor plugged in to the box.
Great for servers, you don't need to buy keyboard, mouse, monitor etc. to use.
4.4 Cons
You cant play games with it.
Images lag the connection.
In order to start the server you have to log into your account, meaning if youre on
vacation and your computer locks up, youll have to have someone else reboot the
computer and log in with your password. But this problem can be fixed by modifying a
DLL file and adding a registry value. And up to 2 more computers can be connected
remotely at the same time.
4.5 SCREEN SHOTS
System info:
31
-
8/8/2019 Senthil Documentation
32/73
`
4.6 Explorer:
.4.7Service form:
32
-
8/8/2019 Senthil Documentation
33/73
`
4.8 Process form:
4.9 Bitmap Functions
Win32 function Description .NET Framework API
AlphaBlend Displays a System.Drawing.Graphics.DrawImage
33
-
8/8/2019 Senthil Documentation
34/73
`
bitmap withtransparent or
semitransparent
pixels.
BitBlt Performs a bit-
block transfer.
System.Drawing.Graphics.DrawImage
CreateBitmap Creates abitmap.
System.Drawing.Bitmap constructor
Note Creates a DIB, not a DDB.
GetBitmapDimensionEx Gets the
dimensions of a
bitmap.
System.Drawing.Bitmap.Size
GetDIBColorTable Retrieves RGB
color valuesfrom a DIB
section bitmap.
System.Drawing.Bitmap.Palette
GetDIBits Copies abitmap into abuffer.
System.Drawing.Bitmap.LockBits
GetPixel Gets the RGBcolor value of
the pixel at a
givencoordinate.
System.Drawing.Bitmap.GetPixel
GradientFill Fills rectangle
and triangle
structures.
System.Drawing.Graphics.FillRectangle(Drawing2D.LinearGr
adiantBrush, Rectangle)
LoadBitmap Loads a bitmapfrom amodule's
executable file.
System.Drawing.Bitmap.Bitmap(Type, String)
Set
Pixel
Sets
the color for apixel.
System.Drawing.Bitmap.SetPixel
SetPixelV Sets a pixel to
the best
approximation
of a color.
System.Drawing.Bitmap.SetPixel(,
Graphics.GetNearestColor(Color))
StretchBlt Copies abitmap and
stretches or
System.Drawing.Graphics.DrawImage
Brush Functions
Win32 function Description .NET Framework API
34
-
8/8/2019 Senthil Documentation
35/73
`
CreateBrushIndirect Creates a brushwith a specified
style, color, and
pattern.
Any of the following:
System.Drawing.Brushes
System.Drawing.SolidBrush
System.Drawing.TextureBrush
System.Drawing.Drawing2D.HatchBrush
System.Drawing.Drawing2D.LinearGradientBrushSystem.Drawing.Drawing2D.PathGradientBrush
CreateHatchBrush Creates a brush
with a hatchpattern and color.
System.Drawing.Drawing2D.HatchBrush
constructor
CreatePatternBrush Creates a brush
with a bitmap
pattern.
System.Drawing.TextureBrush constructor
CreateSolidBrush Creates a brushwith a solid color.
System.Drawing.SolidBrush constructor
GetSysColorBrush Gets a handle for
a brush thatcorresponds to a
color index.
System.Drawing.Brushes class
5.0 IMPLEMENTATION ON CLIENT MACHINES:
1.Go to Run Command
Services.msc
*Network Sharing
*COM+EVENT
*COM+SYSTEM APPLICATION
* Remote Access System Manager
*Remote Acess Connection Manager
*Remote Procedure Call
*Remote Registry
*Remote Storage
*Telnet
*Windows Firewall
*Windows Management Instrumentation
* Windows Management Instrumentation Driver
Properties
Assign it as AUTOMATIC
2.Go to Run Command
35
-
8/8/2019 Senthil Documentation
36/73
`
Secpol.msc
Network access Classic
3.My Computer
*Manage
*WMI Program
*WMI Services
*Properties
*Logging on
*Assign Verbose
*WMI control
*Security
*Allow all user
3.Fire wall
*Exception*Check all the boxes
*Apply
4.Password
*Users
*Set Password
*Apply
Graphical Representation Of Implementing Client Machine
Run Command
Services.msc:
36
-
8/8/2019 Senthil Documentation
37/73
`
Network Sharing:
COM+EVENT
37
-
8/8/2019 Senthil Documentation
38/73
`
COM+SYSTEM APPLICATION
Remote Access Connection Manager:
Remote Desktop Help Session
38
-
8/8/2019 Senthil Documentation
39/73
`
Telnet:
Windows Management Instrumentation:
39
-
8/8/2019 Senthil Documentation
40/73
`
2. Go to Run Command:
40
-
8/8/2019 Senthil Documentation
41/73
`
Network access:
41
-
8/8/2019 Senthil Documentation
42/73
`
My Computer
*Manage
42
-
8/8/2019 Senthil Documentation
43/73
`
WMI Program:
WMI Services:
43
-
8/8/2019 Senthil Documentation
44/73
`
Assign Verbose:
Allow all user:
44
-
8/8/2019 Senthil Documentation
45/73
-
8/8/2019 Senthil Documentation
46/73
`
Exception:
Check all the boxes
Password:
46
-
8/8/2019 Senthil Documentation
47/73
`
Set Password:
47
-
8/8/2019 Senthil Documentation
48/73
`
6.0 Source code:
48
-
8/8/2019 Senthil Documentation
49/73
`
using System;
using System.Management;
namespace completionHandler
{
///
/// MyHandler class handle notification when InvokeMethod call is complete
///
publicclassMyHandler
{
privatebool isComplete = false;
privateManagementBaseObject returnObject;
///
/// Trigger Done event when InvokeMethod is complete
///
///
///
publicvoid Done(object sender, ObjectReadyEventArgs e)
{
isComplete = true;
returnObject = e.NewObject;
}
///
/// Get property IsComplete
///
publicbool IsComplete
{
get
{
49
-
8/8/2019 Senthil Documentation
50/73
`
return isComplete;
}
}
///
/// Property allows accessing the result object in the main function
///
publicManagementBaseObject ReturnObject
{
get
{
return returnObject;
}
}
}
}
2. process dictionary
using System;
using System.Collections.Specialized;
namespace ProcessesDictionary
{
///
///
///
publicstructstructProcessInfo
{
publicstring stringName;
publicstring stringProcessID;
publicstring stringParentProcessID;
50
-
8/8/2019 Senthil Documentation
51/73
`
publicstring stringUserName;
}
publicclassProcessesInfo
{
privatestructProcessInfo _value;
///
/// property Value
///
publicstructProcessInfo Value
{
get {return _value;}
set {_value = value;}
}
}
///
/// Summary description for Dictionary.
///
publicclassProcessesDictionary :NameObjectCollectionBase
{
///
/// Clear dictionary
///
publicvoid Clear()
{
BaseClear();
}
///
/// Add item to dictionary
///
///
///
51
-
8/8/2019 Senthil Documentation
52/73
`
publicvoid Add(string name, ProcessesInfo processObj)
{
BaseAdd(name, processObj);
}
///
/// Remove item from dictionary
///
///
publicvoid Remove(string name)
{
BaseRemove(name);
}
///
/// Index remove item from dictionary
///
///
publicvoid RemoveAt(int index)
{
BaseRemoveAt(index);
}
///
/// ProcessesInfo property by index
///
publicProcessesInfothis[int index]
{
get {return (ProcessesInfo)BaseGet(index);}
set {BaseSet(index, value);}
}
///
/// processInfo property by key
///
52
-
8/8/2019 Senthil Documentation
53/73
`
publicProcessesInfothis[string name]
{
get {return (ProcessesInfo)BaseGet(name);}
set {BaseSet(name, value);}
}}}
3. Process performance dictionary:
using System;
using System.Collections.Specialized;
namespace ProcessesPerformanceDictionary
{
///
/// Process performance data structure
///
publicstructstructPerformance
{
publicstring stringPercentProcessorTime;
publicstring stringVirtualBytes;
}
publicclassProcessPerf
{
privatestructPerformance _value;
///
/// Property
///
publicstructPerformance Value
{
get {return _value;}
set {_value = value;}
} }
///
/// This Dictionary contains process performance data.
53
-
8/8/2019 Senthil Documentation
54/73
`
///
publicclassDictionary :NameObjectCollectionBase
{
///
/// Clear dictionary
///
publicvoid Clear()
{
BaseClear();
}
///
/// Add item to dictionary
///
///
///
publicvoid Add(string name, ProcessPerfprocessPerformance)
{
BaseAdd(name, processPerformance);
}
///
/// Remove item from dictionary by key
///
///
publicvoid Remove(string name)
{
BaseRemove(name);
}
///
/// Remove item from dictionary by index
///
///
54
-
8/8/2019 Senthil Documentation
55/73
`
publicvoid RemoveAt(int index)
{
BaseRemoveAt(index);
}
///
/// Access ProcessPerf item by index
///
publicProcessPerfthis[int index]
{
get {return (ProcessPerf)BaseGet(index);}
set {BaseSet(index, value);}
}
///
/// Access ProcessPerf item by key
///
publicProcessPerfthis[string name]
{
get {return (ProcessPerf)BaseGet(name);}
set {BaseSet(name, value);}
}
}
}
Services .cs
using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;
using System.Management;
namespace WindowsServicesControlLibrary
55
-
8/8/2019 Senthil Documentation
56/73
`
{
///
/// Display srvices informatin.
///
publicclass Srvices : System.Windows.Forms.UserControl
{
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.ListView listViewServices;
private System.Windows.Forms.Button buttonRefresh;
private System.Windows.Forms.RadioButton radioRemoteMachine;
private System.Windows.Forms.TextBox textPassword;
private System.Windows.Forms.TextBox textUserID;
private System.Windows.Forms.Label labelPassword;
private System.Windows.Forms.Label labelUserID;
private System.Windows.Forms.Label labelIP;
private System.Windows.Forms.TextBox textIP;
private System.Windows.Forms.RadioButton radioMachine;
publicevent Status UpdateStatus;
privatestring stringServiceName = "";
privatestring stringServiceAction = "";
private ListViewItem listViewServiceItem;
privatebool boolLoaded = false;
public Srvices()
{
// This call is required by the Windows.Forms Form Designer.
InitializeComponent();
// Init list view
InitListView();
// Init boolLoaded flag
boolLoaded = false;
}
56
-
8/8/2019 Senthil Documentation
57/73
`
///
/// Clean up any resources being used.
///
protectedoverridevoid Dispose(bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
/// privatevoid InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.Resources.ResourceManager resources = new
System.Resources.ResourceManager(typeof(Srvices));
this.panel1 = new System.Windows.Forms.Panel();
this.buttonRefresh = new System.Windows.Forms.Button();
this.radioRemoteMachine = new System.Windows.Forms.RadioButton();
this.textPassword = new System.Windows.Forms.TextBox();
this.textUserID = new System.Windows.Forms.TextBox();
this.labelPassword = new System.Windows.Forms.Label();
this.labelUserID = new System.Windows.Forms.Label();
this.labelIP = new System.Windows.Forms.Label();
this.textIP = new System.Windows.Forms.TextBox();
this.radioMachine = new System.Windows.Forms.RadioButton();
this.listViewServices = new System.Windows.Forms.ListView();
57
-
8/8/2019 Senthil Documentation
58/73
`
this.imageList = new
System.Windows.Forms.ImageList(this.components);
this.panel1.SuspendLayout();
this.SuspendLayout();
//
// panel1
//
this.panel1.Dock = System.Windows.Forms.DockStyle.Right;
this.panel1.Location = new System.Drawing.Point(632, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(128, 512);
this.panel1.TabIndex = 0;
//
// buttonRefresh
//
this.buttonRefresh.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonRefresh.Location = new System.Drawing.Point(29, 16);
this.buttonRefresh.Name = "buttonRefresh";
this.buttonRefresh.Size = new System.Drawing.Size(75, 24);
this.buttonRefresh.TabIndex = 10;
this.buttonRefresh.Text = "&Refresh";
this.buttonRefresh.Click += new
System.EventHandler(this.buttonRefresh_Click);
//
// radioRemoteMachine
//
this.textPassword.Location = new System.Drawing.Point(13, 272);
this.textPassword.Name = "textPassword";
this.textPassword.PasswordChar = '*';
this.textPassword.Size = new System.Drawing.Size(104, 20);
this.textPassword.TabIndex = 18;
58
-
8/8/2019 Senthil Documentation
59/73
`
this.textPassword.Text = "";
this.textPassword.Visible = false;
//
// textUserID
//
this.textUserID.Location = new System.Drawing.Point(13, 208);
this.textUserID.Name = "textUserID";
this.textUserID.Size = new System.Drawing.Size(104, 20);
this.textUserID.TabIndex = 16;
this.textUserID.Text = "";
this.textUserID.Visible = false;
//
// labelPassword
//
this.labelPassword.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.labelPassword.Location = new System.Drawing.Point(13, 248);
this.labelPassword.Name = "labelPassword";
this.labelPassword.Size = new System.Drawing.Size(100, 16);
this.labelPassword.TabIndex = 17;
this.labelPassword.Text = "&Password:";
this.labelPassword.Visible = false;
//
// labelUserID
//
this.labelUserID.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.labelUserID.Location = new System.Drawing.Point(13, 184);
this.labelUserID.Name = "labelUserID";
this.labelUserID.Size = new System.Drawing.Size(100, 16);
this.labelUserID.TabIndex = 15;
this.labelUserID.Text = "&User ID:";
this.labelUserID.Visible = false;
59
-
8/8/2019 Senthil Documentation
60/73
`
//
// labelIP
//
this.labelIP.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.labelIP.Location = new System.Drawing.Point(13, 120);
this.labelIP.Name = "labelIP";
this.labelIP.Size = new System.Drawing.Size(112, 16);
this.labelIP.TabIndex = 13;
this.labelIP.Text = "&IP or Machine Name:";
this.labelIP.Visible = false;
//
// textIP
//
this.textIP.Location = new System.Drawing.Point(13, 144);
this.textIP.Name = "textIP";
this.textIP.Size = new System.Drawing.Size(104, 20);
this.textIP.TabIndex = 14;
this.textIP.Text = "";
this.textIP.Visible = false;
//
// radioMachine
//
this.radioMachine.Checked = true;
this.radioMachine.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.radioMachine.Location = new System.Drawing.Point(13, 56);
this.radioMachine.Name = "radioMachine";
this.radioMachine.Size = new System.Drawing.Size(120, 24);
this.radioMachine.TabIndex = 11;
this.radioMachine.TabStop = true;
this.radioMachine.Text = "&Current Machine";
60
-
8/8/2019 Senthil Documentation
61/73
`
this.radioMachine.CheckedChanged += new
System.EventHandler(this.radioMachine_CheckedChanged);
System.Windows.Forms.SortOrder.Ascending;
this.listViewServices.TabIndex = 1;
this.listViewServices.View = System.Windows.Forms.View.Details;
this.listViewServices.MouseDown += new
System.Windows.Forms.MouseEventHandler(this.listViewServices_MouseDown);
//
// imageList
//
this.imageList.ColorDepth =
System.Windows.Forms.ColorDepth.Depth8Bit;
this.imageList.ImageSize = new System.Drawing.Size(16, 16);
this.imageList.ImageStream
///
/// Get services and populate list view
///
privatevoid getServices()
{
ManagementObjectCollection queryCollection;
string[] lvData = newstring[4];
try
{
queryCollection = getServiceCollection("SELECT * FROM
Win32_Service");
foreach ( ManagementObject mo in queryCollection)
{
//create child node for operating system
lvData[0] = mo["Name"].ToString();
lvData[1] = mo["StartMode"].ToString();
61
-
8/8/2019 Senthil Documentation
62/73
`
if(mo["Started"].Equals(true))
lvData[2] = "Started";
else
lvData[2] = "Stop";
lvData[3] = mo["StartName"].ToString();
//create list item
ListViewItem lvItem = new ListViewItem(lvData,0);
listViewServices.Items.Add(lvItem);
}
}
catch (Exception e)
{
MessageBox.Show("Error: " + e);
}
//Status
updateStatus("Ready");
this.Update();
}
}
///
/// Update status
///
///
privatevoid updateStatus(string stringStatus)
{
if(UpdateStatus != null)
62
-
8/8/2019 Senthil Documentation
63/73
`
UpdateStatus(stringStatus );
}
///
/// radioMachine_CheckedChanged event allow user to access services on other
machine
///
///
///
privatevoid radioMachine_CheckedChanged(object sender, System.EventArgs e)
{
bool booleanFlag = true;
RadioButton rbClicked = (RadioButton) sender;
if(rbClicked.Text == "&Current Machine")
booleanFlag = false;
//toggle controls
labelIP.Visible = booleanFlag;
textIP.Visible = booleanFlag;
labelUserID.Visible = booleanFlag;
textUserID.Visible = booleanFlag;
labelPassword.Visible = booleanFlag;
textPassword.Visible = booleanFlag;
}
///
/// buttonRefresh click event allow user to refresh service list view
///
///
63
-
8/8/2019 Senthil Documentation
64/73
`
///
privatevoid buttonRefresh_Click(object sender, System.EventArgs e)
{
//call refresh function
this.Refresh();
}
///
/// List view mouse down event to built context menu dynamically
///
///
///
///
/// List view context menu click event to invoke start/stop service
///
///
///
privatevoid menuItem_Click(object sender, System.EventArgs e)
{
ManagementObjectCollection queryCollection;
ListViewItem lvItem;
//Set up a handler for the asynchronous callback
ManagementOperationObserver observer = new
ManagementOperationObserver();
completionHandler.MyHandler completionHandlerObj = new
completionHandler.MyHandler();
observer.ObjectReady += new
ObjectReadyEventHandler(completionHandlerObj.Done);
//get specific service object
64
-
8/8/2019 Senthil Documentation
65/73
`
queryCollection = getServiceCollection("Select * from Win32_Service
Where Name = '" + ServiceName + "'");
//Status
updateStatus("Starting/Stopping service...");
foreach ( ManagementObject mo in queryCollection)
{
//start or stop service
mo.InvokeMethod(observer, ServiceAction, null);
}
//wait until invoke method is complete or 5 sec timeout
int intCount = 0;
while (!completionHandlerObj.IsComplete)
{
if(intCount > 10)
{
MessageBox.Show("Terminate process timed out.",
"Terminate Process Status");
break;
}
//wait 1/2 sec.
System.Threading.Thread.Sleep(500);
//increment counter
intCount++;
}
//see if call was successful.
65
-
8/8/2019 Senthil Documentation
66/73
`
if
(completionHandlerObj.ReturnObject.Properties["returnValue"].Value.ToString() == "0")
{
//succeeded
lvItem = ServiceItem;
if(ServiceAction == "StartService")
lvItem.SubItems[2].Text = "Started";
else
lvItem.SubItems[2].Text = "Stop";
}
else
{
//error message
string stringAction;
if(ServiceAction == "StartService")
stringAction = "start";
else
stringAction = "stop";
MessageBox.Show("Failed to " + stringAction + " service " +
ServiceName + ".", "Start/Stop Service Failure");
}
//clean-up objects
ServiceName = "";
ServiceAction = "";
ServiceItem = null;
//Status
66
-
8/8/2019 Senthil Documentation
67/73
`
updateStatus("Ready");
this.Update();
}
///
/// Get computer service collection
///
///
///queryCollection
private ManagementObjectCollection getServiceCollection(string stringQuery)
{
ManagementObjectSearcher query;
ManagementObjectCollection queryCollection = null;
System.Management.ObjectQuery oq;
string stringMachineName = "";
//Connect to the remote computer
ConnectionOptions co = new ConnectionOptions();
if(radioMachine.Checked == true)
{
stringMachineName = "localhost";
}
else
{
stringMachineName = textIP.Text;
}
if(stringMachineName.Trim().Length == 0)
{
MessageBox.Show("Must enter machine IP address or name.");
67
-
8/8/2019 Senthil Documentation
68/73
`
returnnull;
}
//get user and password
if(textUserID.Text.Trim().Length > 0)
{
co.Username = textUserID.Text;
co.Password = textPassword.Text;
}
//Point to machine
System.Management.ManagementScope ms = new
System.Management.ManagementScope("\\\\" + stringMachineName + "\\root\\cimv2", co);
//Status
updateStatus("Getting Services Information");
//Query remote computer across the connection
oq = new System.Management.ObjectQuery(stringQuery);
query = new ManagementObjectSearcher(ms,oq);
try
{
queryCollection = query.Get();
}
catch (Exception e1)
{
MessageBox.Show("Error: " + e1);
}
68
-
8/8/2019 Senthil Documentation
69/73
-
8/8/2019 Senthil Documentation
70/73
`
70
-
8/8/2019 Senthil Documentation
71/73
-
8/8/2019 Senthil Documentation
72/73
`
72
-
8/8/2019 Senthil Documentation
73/73
`
8.0BIBLIOGRAPHY
*VC#.NET, James Goodwill,G.C.Jain for Techmedia, FIRST INDIAN EDITION
VC#.NET COMPLETE REFERENCE, Herbert Schildt,3rd Edition, Mc Graw Hill
*WWW.MICROSOFT.COM.