Você está na página 1de 65

Session: 2010-11

“COMPUTER LAB MANAGEMENT SYSTEM”

A Report Submitted to Department of Information Technology in


partial fulfillment of B Tech Degree
Of
Rajasthan Technical University (KOTA)

Submitted To Guided By Submitted By


Prof. L.K.Sharma Mr. Hemant Saini Vinay Singh (07EAEITO60)
HOD IT DEPT I.T Dept Vipin Narang (07EAEIT061)
Candidate’s Declaration

I hereby declare that the work, which is being presented in this report, entitled
“Computer Lab Management System” in partial fulfillment for the award of
Degree of “Bachelor of Technology” in department of Information Technology,
Alwar Institute of Engineering and Technology affiliated to Rajasthan Technical
University, Kota is a record of my own investigations carried under the Guidance
of Mr. Hemant Saini, I.T. Dept, AIET Alwar.

I have not submitted the matter presented in this report any where for the award of
any other Degree.

Submitted By:-

Vipin Narang Vinay Singh


07EAEIT061 07EAEIT060

2
Preface

This Document is an initial project report for the fulfillment of Project Phase I
requirements for the award of the degree of Bachelor of Technology. This document
describes software requirements and design Specification of the project. The
requirements mentioned in this document are subjected to change and revisions in
future, thus the software requirements presented in this document should be considered
the agreed-upon specifications at the time of submission of documents only. The design
specification mentioned in this project are also subjected to change in future and will be
presented in separate software design specification document, thus the design
specification presented in this document should be consider the agreed-upon at the
time of submission only. Although this document is not indented as a living document
but there may be future revision and addition in project phase II.As the software
development life cycle is a dynamic process in which our understanding of the project
and its criteria of success are refined over times. It is therefore expected that the design
and requirement specification will undergo many revisions, thus anyone seeking
information in that regard should refer the corresponding document.

3
Acknowledgement

Guidance and Inspiration are indispensable in all walks of life. We express our sincere
sense of gratitude to our guide Mr. Hemant Saini (Lecturer) for his constant support
and help me for a proper direction.

We also wish to extend appreciation to my colleagues at A.I.E.T., Alwar who offered


many suggestions throughout this work.

Finally we like to thank Prof. L.K.Sharma (Head of C.S. & I.T., A.I.E.T. Alwar) for giving
inspiration and providing every possible support.

Vipin Narang Vinay Singh


VII SEM VII SEM

4
CERTIFICATE

This is to certify that the work related to the Project entitled on “Computer Lab
Management System” has been carried out by Vipin Narang and Vinay Singh of
B.Tech. (I.T.) under my supervision.

Submitted to Guided By

Prof. L.K.Sharma Mr. Hemant Saini


Head of C.S. & I.T Lecturer I.T. Dept.
A.I.E.T(Alwar) A.I.E.T (Alwar)

5
Table of Contents
...................................................................................................................................................... 2
Candidate’s Declaration.............................................................................................. 2
................................................................................ 8
Definitions and Abbreviations. ............................................................................................................... 8
Introduction.............................................................................................................................................. 9
The project is aimed at fetching and managing all the information related to System Hardware
configuration like Processor, Motherboard, HDD, CDROM................................................................. 10
Keyboard, Pointing Device, Network Card etc of different client node connected to server and
generates a log detail of any alteration. The scope of the project is wide enough and ranges from small
scale like small computer labs to large scale network system of thousands of computer.It will help in
detection of working status of any system component of any system by just checking it through the
server application and help to diagnose any theft attempt and removal and addition of any components
in the system.It will provide a detail report of the system components modification and changes........10
Syntax....................................................................................................................................17
3.2.3Win32_CDROMDrive Class............................................................................................... 18
Syntax....................................................................................................................................18
3.2.4Win32_Processor Class....................................................................................................... 19
Syntax....................................................................................................................................20
3.2.5Win32_NetworkAdapter Class........................................................................................... 21
3.2.6Win32_DesktopMonitor Class............................................................................................22
Syntax....................................................................................................................................22
3.2.7Win32_DiskDrive Class.......................................................................................................23
Syntax....................................................................................................................................23
3.2.8Win32_OperatingSystem Class.......................................................................................... 25
Syntax....................................................................................................................................25
3.2.9Win32_ComputerSystem Class.......................................................................................... 27
Syntax....................................................................................................................................27
3.2.10 Win32_PhysicalMemory Class........................................................................................ 28
Syntax....................................................................................................................................28
5.1 Specific Requirements ........................................................................................................ 38
5.2 User Characteristics ........................................................................................................................ 39
5.3 Design and Implementation Constraints........................................................................................... 39
5.4 Assumptions and Dependencies........................................................................................................ 39
5.6 Interfaces..........................................................................................................................40
5.6.1 Hardware Interfaces......................................................................................................41
5.6.2Software Interfaces........................................................................................................41
5.7 Product Functions ............................................................................................................................. 41
Fig 6.1 CLMS Database Architecture ...................................................................................43
43
CLMS is a project developed for the surveillance of computers in a computer lab. CLMS
application can be implemented in the school as well as college lab where there is a need
of keeping all the information about system configuration as this application maintains
a database for the system hardware configuration.it can be also used for maintaining
lab inventory. In future it can also be upgraded to keep vigilance of the system ..........51
11.Testing......................................................................................................................................51
11.1 Overview......................................................................................................................................... 51
11.2Testing Methods............................................................................................................................... 52

6
11.2.1Unit Testing.................................................................................................................52
11.2.2Alpha Testing...............................................................................................................52
11.2.3Beta Testing.................................................................................................................53
11.3 Test Report...................................................................................................................................... 53
11.3.1 API Test......................................................................................................................53
11.3.2 Unit Tests....................................................................................................................53
11.3.3 Alpha Test...................................................................................................................54
13.Refernces: ....................................................................................................................................... 64
.............................................................................................................................................................. 65
Books:.................................................................................................................................................. 65

List of Figures

Figure 3.1(Architecture Of WMI).............................................................................................. 13

Figure 3.2(CLMS Architecture)................................................................................................. 28

Figure 4.1(Flow Chart of CLMS Client)....................................................................................30

Figure 4.2(Flow Chart of CLMS Server)...................................................................................31

Figure 4.3(O-level DFD).............................................................................................................. 33

Figure 4.4(1-level DFD)............................................................................................................... 34

Figure 4.5(USE CASE diagram of CLMS)................................................................................36

Figure 6.1(CLMS Database Architecture)................................................................................ 41

Figure 7.1(Login Screen)............................................................................................................. 42

Figure 7.2(User Management Screen)........................................................................................43

Figure 7.3(Log).............................................................................................................................44

Figure 7.4(Inventory)...................................................................................................................45

Figure 7.5(Inventory update)......................................................................................................46

Figure 7.6(Node)...........................................................................................................................47

7
Figure 7.7(Create User)............................................................................................................... 48

Definitions and Abbreviations.

Definitions:-

CLMS: Computer Lab Management System

Client: PC node that exist in lab

Server: PC that will provide services to the client also manages clients.

Admin: A Person who will use the Server.

CLMS SERVER: Software which will run on Server

CLMS Client: Software which will run on Client

WMI: Windows Management Instrumentation

Abbreviations:-
.NET Application Developer New Enterprise Technology

8
Introduction

The purpose of the SRS (Software Requirement Specification) document is to


present a detailed description of the Computer Lab Management System. It will
explain the purpose and features of the system, the interfaces of the system,
what the system will do, the constraints under which it must operate and how the
system will react to external stimuli. This document is intended for both the
stakeholders and the developers of the system.

CLMS is a integrated software which have two applications one is server-side


and other is client-side which works parallel to each other but are logically
connected to accomplish the desired objective. CLMS client application is
basically involved in fetching the system hardware configuration detail from a
client node of the computer lab and store those information in a database present
on the server. Server side application will check earlier entry of the database with
new entries and if it found any changes in the configuration entries it will figure it
out and generate a log containing the details of the of any amendments in the
hardware of the specific system. The project provides a well-defined user

9
interface on the server-side to the Vigilator and also provides security measure
from unauthorized access to the software.

The project is aimed at fetching and managing all the information related to
System Hardware configuration like Processor, Motherboard, HDD, CDROM
Keyboard, Pointing Device, Network Card etc of different client node connected
to server and generates a log detail of any alteration. The scope of the project is
wide enough and ranges from small scale like small computer labs to large scale
network system of thousands of computer.It will help in detection of working
status of any system component of any system by just checking it through the
server application and help to diagnose any theft attempt and removal and
addition of any components in the system.It will provide a detail report of the
system components modification and changes.

2. Synopsis of Computer Lab Management System

2.1Project Description:

Computer Lab Management System(CMLS) basically work on detecting any kind


of configuration changes and addition of specific computer components in a
particular computer system of lab and will report these changes to the main
server to which the computer system of the lab is connected. This project will be
tried to implement using WMI (Window Management Instrumentation) classes of
Microsoft Windows operating system to detect the current system configuration
and will use classes like DeviceChangeEvent classes of WMI core to fire a pop
up in the server about the changes.

2.2Technical detail
Hardware Required:-

1. PROCESSOR: 1.6Ghz

10
2. RAM : 256Mb

3. HARDDISK :20GB

Software Required:-

1. Operating System Windows 2007, Xp,


Vista
2. Environment VisualStudio.Net
2005/2008
3. Front end Tool C#
4. Technology C#.Net
5. Other Requirement C++ Program File

2.3Aim

To detect any addition and change in components of a Lab computer and reflect
those changes on the server system to which the computer are connected.

2.4Innovativeness & Usefulness

This project will be useful for the purpose of the fetching the data from the client
node and then store the data on the server database

2.5Current Status of Development

Under feasible study and requirement analysis.

11
2.6Market Potential & Competitive advantage

This project is useful for the purpose of the Computer Lab


Management System by the help of this project we can get all the information
about the selected node of the computer Lab and can view the information on the
server and modify the information and can keep track of the all lab computer
system.
_________________________________________________

3. The Overall Description

3.1 CLMS CLIENT:

CLMS client application is basically involved in fetching the system hardware


configuration detail from a client node of the computer lab. This application
basically obtains the information from cimv2 file present in operating system
folder. The information from this file is obtained by firing WMI queries on the
system.WMI query are the query from the Window Management Instrumentation
classes. Windows Management Instrumentation (WMI) is the infrastructure for
management data and operations on Windows-based operating system.
Windows Management Instrumentation (WMI) is the Microsoft implementation of
Web-based Enterprise Management (WBEM), which is an industry initiative to
develop a standard technology for accessing management information in an
enterprise environment. WMI uses the Common Information Model (CIM)

12
industry standard to represent systems, applications, networks, devices, and
other managed components. CIM is developed and maintained by the Distributed
Management Task Force.

13
14
Fig:3.1WMI Architecture

CLMS Client is basically a application designed on .NET platform Using Window


forms and C# in logic base. As shown in the Architecture diagram .NET

15
application implements a namespace “System Management” which provide
interface between Client application and WMI core.WMI core is then further
interfaced to WMI providers and manages objects. The detail of the different
hardware devices is obtained from the WMI repository is then collected by the
application which is scheduled to do so repeatedly at definite interval of time and
stores those information in the database situated at server.

3.2WMI CLASSES DESCRIPTION

3.2.1Win32_Keyboard Class
The Win32_Keyboard WMI class represents a keyboard installed on a computer
system running Windows.The following syntax is simplified from Managed Object
Format (MOF) code and includes all of the inherited properties. Properties are
listed in alphabetic order, not MOF order.

Syntax
class Win32_Keyboard : CIM_Keyboard
{
uint16 Availability;
string Caption;
uint32 ConfigManagerErrorCode;
Boolean ConfigManagerUserConfig;
string CreationClassName;
string Description;
string DeviceID;
Boolean ErrorCleared;
string ErrorDescription;
datetime InstallDate;
Boolean IsLocked;
uint32 LastErrorCode;
string Layout;
string Name;
uint16 NumberOfFunctionKeys;
uint16 Password;
string PNPDeviceID;
uint16 PowerManagementCapabilities[];

16
Boolean PowerManagementSupported;
string Status;
uint16 StatusInfo;
string SystemCreationClassName;
string SystemName;
};

3.2.2Win32_PointingDevice Class
The Win32_PointingDevice WMI class represents an input device used to point
to and select regions on the display of a computer system running Windows. Any
device used to manipulate a pointer, or point to the display on acomputer system
running Windows is a member of this class.

The following syntax is simplified from Managed Object Format (MOF) code and
includes all of the inherited properties. Properties are listed in alphabetic order,
not MOF order.

Syntax
class Win32_PointingDevice : CIM_PointingDevice
{
uint16 Availability;
string Caption;
uint32 ConfigManagerErrorCode;
Boolean ConfigManagerUserConfig;
string CreationClassName;
string Description;
string DeviceID;
uint16 DeviceInterface;
uint32 DoubleSpeedThreshold;
Boolean ErrorCleared;
string ErrorDescription;
uint16 Handedness;
string HardwareType;
string InfFileName;
string InfSection;
datetime InstallDate;
Boolean IsLocked;
uint32 LastErrorCode;
string Manufacturer;
string Name;

17
uint8 NumberOfButtons;
string PNPDeviceID;
uint16 PointingType;
uint16 PowerManagementCapabilities[];
Boolean PowerManagementSupported;
uint32 QuadSpeedThreshold;
uint32 Resolution;
uint32 SampleRate;
string Status;
uint16 StatusInfo;
uint32 Synch;
string SystemCreationClassName;
string SystemName;
};

3.2.3Win32_CDROMDrive Class
The Win32_CDROMDrive WMI class represents a CD-ROM drive on a computer
system running Windows. Be aware that the name of the drive does not correspond to
the logical drive letter assigned to the device.

The following syntax is simplified from Managed Object Format (MOF) code and
includes all of the inherited properties. Properties are listed in alphabetic order, not MOF
order.

Syntax
class Win32_CDROMDrive : CIM_CDROMDrive
{
uint16 Availability;
uint16 Capabilities[];
string CapabilityDescriptions[];
string Caption;
string CompressionMethod;
uint32 ConfigManagerErrorCode;
Boolean ConfigManagerUserConfig;
string CreationClassName;
uint64 DefaultBlockSize;
string Description;
string DeviceID;
string Drive;
Boolean DriveIntegrity;
Boolean ErrorCleared;

18
string ErrorDescription;
string ErrorMethodology;
uint16 FileSystemFlags;
uint32 FileSystemFlagsEx;
string Id;
datetime InstallDate;
uint32 LastErrorCode;
string Manufacturer;
uint64 MaxBlockSize;
uint32 MaximumComponentLength;
uint64 MaxMediaSize;
Boolean MediaLoaded;
string MediaType;
string MfrAssignedRevisionLevel;
uint64 MinBlockSize;
string Name;
Boolean NeedsCleaning;
uint32 NumberOfMediaSupported;
string PNPDeviceID;
uint16 PowerManagementCapabilities[];
Boolean PowerManagementSupported;
string RevisionLevel;
uint32 SCSIBus;
uint16 SCSILogicalUnit;
uint16 SCSIPort;
uint16 SCSITargetId;
uint16 SerialNumber;
uint64 Size;
string Status;
uint16 StatusInfo;
string SystemCreationClassName;
string SystemName;
real64 TransferRate;
string VolumeName;
string VolumeSerialNumber;
};

3.2.4Win32_Processor Class
The Win32_Processor WMI class represents a device that can interpret a sequence of
instructions on a computer running on a Windows operating system. On a
multiprocessor computer, one instance of the Win32_Processor class exists for each
processor.

19
The following syntax is simplified from Managed Object Format (MOF) code and
includes all of the inherited properties. Properties are listed in alphabetic order, not MOF
order.

Syntax
class Win32_Processor : CIM_Processor
{
uint16 AddressWidth;
uint16 Architecture;
uint16 Availability;
string Caption;
uint32 ConfigManagerErrorCode;
Boolean ConfigManagerUserConfig;
uint16 CpuStatus;
string CreationClassName;
uint32 CurrentClockSpeed;
uint16 CurrentVoltage;
uint16 DataWidth;
string Description;
string DeviceID;
Boolean ErrorCleared;
string ErrorDescription;
uint32 ExtClock;
uint16 Family;
datetime InstallDate;
uint32 L2CacheSize;
uint32 L2CacheSpeed;
uint32 L3CacheSize;
uint32 L3CacheSpeed;
uint32 LastErrorCode;
uint16 Level;
uint16 LoadPercentage;
string Manufacturer;
uint32 MaxClockSpeed;
string Name;
uint32 NumberOfCores;
uint32 NumberOfLogicalProcessors;
string OtherFamilyDescription;
string PNPDeviceID;
uint16 PowerManagementCapabilities[];
Boolean PowerManagementSupported;
string ProcessorId;
uint16 ProcessorType;
uint16 Revision;
string Role;
string SocketDesignation;

20
string Status;
uint16 StatusInfo;
string Stepping;
string SystemCreationClassName;
string SystemName;
string UniqueId;
uint16 UpgradeMethod;
string Version;
uint32 VoltageCaps;
};

3.2.5Win32_NetworkAdapter Class
The Win32_NetworkAdapter WMI class represents a network adapter of a computer
running a Windows operating system.

Win32_NetworkAdapter only supplies IPv4 data..

The following syntax is simplified from Managed Object Format (MOF) code and
includes all of the inherited properties. Properties are listed in alphabetic order, not MOF
order.

Syntax

class Win32_NetworkAdapter : CIM_NetworkAdapter


{
string AdapterType;
uint16 AdapterTypeID;
Boolean AutoSense;
uint16 Availability;
string Caption;
uint32 ConfigManagerErrorCode;
Boolean CreationClassName;
string Description;
string DeviceID;
Boolean ErrorCleared;
string ErrorDescription;
string GUID;
uint32 Index;
datetime InstallDate;
boolean Installed;
uint32 InterfaceIndex;
uint32 LastErrorCode;
string MACAddress;
string Manufacturer;

21
uint32 MaxNumberControlled;
uint64 MaxSpeed;
string Name;
string NetConnectionID;
uint16 NetConnectionStatus;
Boolean NetEnabled;
string NetworkAddresses[];
string PermanentAddress;
Boolean PhysicalAdapter;
string PNPDeviceID;
uint16 PowerManagementCapabilities
Boolean PowerManagementSupported;
string ProductName;
string ServiceName;
uint64 Speed;
string Status;
uint16 StatusInfo;
string SystemCreationClassName;
string SystemName;
datetime TimeOfLastReset;
};

3.2.6Win32_DesktopMonitor Class
The Win32_DesktopMonitor WMI class represents the type of monitor or display
device attached to the computer system. Starting with Windows Vista, properties of this
class replace Win32_DisplayConfiguration.

Starting with Windows Vista, hardware that is not compatible with Windows Display
Driver Model (WDDM) returns inaccurate property values for instances of this class.

Windows Server 2003, Windows XP, Windows 2000, and


Windows NT 4.0: This class returns data supplied by hardware compatible with
Windows Device Driver Model (WDDM).

The following syntax is simplified from Managed Object Format (MOF) code and
includes all of the inherited properties. Properties are listed in alphabetic order, not MOF
order.

Syntax
class Win32_DesktopMonitor : CIM_DesktopMonitor
{
uint16 Availability;
uint32 Bandwidth;
string Caption;

22
uint32 ConfigManagerErrorCode;
Boolean ConfigManagerUserConfig;
string CreationClassName;
string Description;
string DeviceID;
uint16 DisplayType;
Boolean ErrorCleared;
string ErrorDescription;
datetime InstallDate;
Boolean IsLocked;
uint32 LastErrorCode;
string MonitorManufacturer;
string MonitorType;
string Name;
uint32 PixelsPerXLogicalInch;
uint32 PixelsPerYLogicalInch;
string PNPDeviceID;
uint16 PowerManagementCapabilities[];
Boolean PowerManagementSupported;
uint32 ScreenHeight;
uint32 ScreenWidth;
string Status;
uint16 StatusInfo;
string SystemCreationClassName;
string SystemName;
};

3.2.7Win32_DiskDrive Class
The Win32_DiskDrive WMI class represents a physical disk drive as seen by a
computer running the Windows operating system. Any interface to a Windows physical
disk drive is a descendent (or member) of this class. The features of the disk drive seen
through this object correspond to the logical and management characteristics of the
drive. In some cases, this may not reflect the actual physical characteristics of the
device. Any object based on another logical device would not be a member of this class.

For security reasons, a user connecting from a remote computer must have the
SC_MANAGER_CONNECT privilege enabled to be able to enumerate this class. The
following syntax is simplified from Managed Object Format (MOF) code and includes all
of the inherited properties. Properties are listed in alphabetic order, not MOF order.

Syntax
class Win32_DiskDrive : CIM_DiskDrive
{

23
uint16 Availability;
uint32 BytesPerSector;
uint16 Capabilities[];
string CapabilityDescriptions[];
string Caption;
string CompressionMethod;
uint32 ConfigManagerErrorCode;
Boolean ConfigManagerUserConfig;
string CreationClassName;
uint64 DefaultBlockSize;
string Description;
string DeviceID;
Boolean ErrorCleared;
string ErrorDescription;
string ErrorMethodology;
string FirmwareRevision;
uint32 Index;
datetime InstallDate;
string InterfaceType;
uint32 LastErrorCode;
string Manufacturer;
uint64 MaxBlockSize;
uint64 MaxMediaSize;
Boolean MediaLoaded;
string MediaType;
uint64 MinBlockSize;
string Model;
string Name;
Boolean NeedsCleaning;
uint32 NumberOfMediaSupported;
uint32 Partitions;
string PNPDeviceID;
uint16 PowerManagementCapabilities[];
Boolean PowerManagementSupported;
uint32 SCSIBus;
uint16 SCSILogicalUnit;
uint16 SCSIPort;
uint16 SCSITargetId;
uint32 SectorsPerTrack;
string SerialNumber;
uint32 Signature;
uint64 Size;
string Status;
uint16 StatusInfo;
string SystemCreationClassName;
string SystemName;

24
uint64 TotalCylinders;
uint32 TotalHeads;
uint64 TotalSectors;
uint64 TotalTracks;
uint32 TracksPerCylinder;
};

3.2.8Win32_OperatingSystem Class
The Win32_OperatingSystem WMI class represents a Windows-based operating
system installed on a computer. Any operating system that can be installed on a
computer that can run a Windows-based operating system is a descendent or member
of this class. Win32_OperatingSystem is a singleton class.To get the single instance,
use "@" for the key.

Windows Server 2003, Windows XP, and Windows 2000: If a computer has
multiple operating systems installed, this class only returns an instance for the
currently active operating system.

The following syntax is simplified from Managed Object Format (MOF) code and
includes all of the inherited properties. Properties and methods are in alphabetic order,
not MOF order.

Syntax
class Win32_OperatingSystem : CIM_OperatingSystem
{
string BootDevice;
string BuildNumber;
string BuildType;
string Caption;
string CodeSet;
string CountryCode;
string CreationClassName;
string CSCreationClassName;
string CSDVersion;
string CSName;
sint16 CurrentTimeZone;
Boolean DataExecutionPrevention_Available;
boolean DataExecutionPrevention_32BitApplications;
Boolean DataExecutionPrevention_Drivers;
uint8 DataExecutionPrevention_SupportPolicy;
boolean Debug;
string Description;
boolean Distributed;

25
uint32 EncryptionLevel;
uint8 ForegroundApplicationBoost;
uint64 FreePhysicalMemory;
uint64 FreeSpaceInPagingFiles;
uint64 FreeVirtualMemory;
datetime InstallDate;
uint32 LargeSystemCache;
datetime LastBootUpTime;
datetime LocalDateTime;
string Locale;
string Manufacturer;
uint32 MaxNumberOfProcesses;
uint64 MaxProcessMemorySize;
string MUILanguages[];
string Name;
uint32 NumberOfLicensedUsers;
uint32 NumberOfProcesses;
uint32 NumberOfUsers;
uint32 OperatingSystemSKU;
string Organization;
string OSArchitecture;
uint32 OSLanguage;
uint32 OSProductSuite;
uint16 OSType;
string OtherTypeDescription;
Boolean PAEEnabled;
string PlusProductID;
string PlusVersionNumber;
boolean Primary;
uint32 ProductType;
string RegisteredUser;
string SerialNumber;
uint16 ServicePackMajorVersion;
uint16 ServicePackMinorVersion;
uint64 SizeStoredInPagingFiles;
string Status;
uint32 SuiteMask;
string SystemDevice;
string SystemDirectory;
string SystemDrive;
uint64 TotalSwapSpaceSize;
uint64 TotalVirtualMemorySize;
uint64 TotalVisibleMemorySize;
string Version;
string WindowsDirectory;
};

26
3.2.9Win32_ComputerSystem Class
The Win32_ComputerSystem WMI class represents a computer system running
Windows.

The following syntax is simplified from Managed Object Format (MOF) code and
includes all of the inherited properties.

Syntax
class Win32_ComputerSystem : CIM_UnitaryComputerSystem
{
uint16 AdminPasswordStatus;
Boolean AutomaticManagedPagefile;
Boolean AutomaticResetBootOption;
Boolean AutomaticResetCapability;
uint16 BootOptionOnLimit;
uint16 BootOptionOnWatchDog;
Boolean BootROMSupported;
string BootupState;
string Caption;
uint16 ChassisBootupState;
string CreationClassName;
sint16 CurrentTimeZone;
Boolean DaylightInEffect;
string Description;
string DNSHostName;
string Domain;
uint16 DomainRole;
Boolean EnableDaylightSavingsTime;
uint16 FrontPanelResetStatus;
Boolean InfraredSupported;
string InitialLoadInfo;
datetime InstallDate;
uint16 KeyboardPasswordStatus;
string LastLoadInfo;
string Manufacturer;
string Model;
string Name;
string NameFormat;
Boolean NetworkServerModeEnabled;
uint32 NumberOfLogicalProcessors;
uint32 NumberOfProcessors;

27
uint8 OEMLogoBitmap[];
string OEMStringArray[];
Boolean PartOfDomain;
sint64 PauseAfterReset;
uint16 PCSystemType;
uint16 PowerManagementCapabilities[];
Boolean PowerManagementSupported;
uint16 PowerOnPasswordStatus;
uint16 PowerState;
uint16 PowerSupplyState;
string PrimaryOwnerContact;
string PrimaryOwnerName;
uint16 ResetCapability;
sint16 ResetCount;
sint16 ResetLimit;
string Roles[];
string Status;
string SupportContactDescription[];
uint16 SystemStartupDelay;
string SystemStartupOptions[];
uint8 SystemStartupSetting;
string SystemType;
uint16 ThermalState;
uint64 TotalPhysicalMemory;
string UserName;
uint16 WakeUpType;
string Workgroup;
};

3.2.10 Win32_PhysicalMemory Class


The Win32_PhysicalMemory WMI class represents a physical memory device located
on a computer system and available to the operating system.

The following syntax is simplified from Managed Object Format (MOF) code and
includes all of the inherited properties. Properties are listed in alphabetic order, not MOF
order.

Syntax
class Win32_PhysicalMemory : CIM_PhysicalMemory
{
string BankLabel;
uint64 Capacity;

28
string Caption;
string CreationClassName;
uint16 DataWidth;
string Description;
string DeviceLocator;
uint16 FormFactor;
Boolean HotSwappable;
Datetime InstallDate;
uint16 InterleaveDataDepth;
uint32 InterleavePosition;
string Manufacturer;
uint16 MemoryType;
string Model;
string Name;
string OtherIdentifyingInfo;
string PartNumber;
uint32 PositionInRow;
Boolean PoweredOn;
boolean Removable;
boolean Replaceable;
string SerialNumber;
string SKU;
uint32 Speed;
string Status;
string Tag;
uint16 TotalWidth;
uint16 TypeDetail;
string Version;
};

3.3 CLMS SERVER:

CLMS server application is subordinate application of the CLMS client. It provide


a user interface to the administrator at server side to inspect any system
configuration stored in the database by client application. It is only way by which
administrator user can interact with the system after verifying itself by providing
authentication detail like username and password. User can fires the query in
the database to fetch the stored information through this application and can also
check the log details of any changes and modification in the specific client node
with time and other required information.

29
Fig.3.2 CLMS Architecture

4. Architecture

4.1 Overview
Flow Chart:-

A flow chart is also called process flow Diagram. A flowchart is a picture of the
separate steps of a process in sequential order.

30
Elements that may be included are: sequence of actions, materials or services
entering or leaving the process (inputs and outputs), decisions that must be
made, time involved at each step and/or process measurements.
The process described can be anything: a manufacturing process, an
administrative or service process, a project plan. This is a generic tool that can
be adapted for a wide variety of purposes.

Commonly Used Symbols in Detailed Flowcharts

One step in the process; the step is written inside the box. Usually, only
one arrow goes out of the box.

Direction of flow from one step or decision to another.

Decision based on a question. The question is written in the diamond.


More than one arrow goes out of the diamond, each one showing the
direction the process takes for a given answer to the question. (Often the
answers are “ yes” and “ no.”)

Delay or wait

Link to another page or another flowchart. The same symbol on the other
page indicates that the flow continues there.

Input or output

Document

Alternate symbols for start and end points

FLOW CHART OF CLMS

31
Fig 4.1 Flowchart of CLMS Client

32
Fig4.2FLOW CHART FOR CLMS SERVER

Explanation:
First of all, when a user wants to run this application, he has to provide a text file
which has a source program written in C++ language or has .cpp Extension. This
file may be stored anywhere in the memory.

33
Then this application will check or verify the source file either it has .cpp
extension or not. After verification if user wants to create tokens of our source
program then he will send a command to the application through a button to
create tokens.
Then this application scans the program character by character and create
tokens in the form of tables. It store the word in its memory and check the word
from the rules defined already. It will remove all the white space and other
comments also. This table contain all the information about the program like
Symbol table contain all the symbols used in the program. Keyword table contain
all the keyword used in the program.Then user can store them if he wants.
Lexical analyser also generates lexical errors identification if present in the
program.

4.2Data flow Diagram:-

A data flow diagram is a graphical representation that depicts information flow


and the transforms that are applied as data move from input to output.The basic
form of Data flow diagram also known as a data flow graph or a bubble chart.
It may be used to represent a system or application at any level of abstraction.
Infact ,DFDs may be partitioned into levels that represent increasing information
flow and functional detail.
Symbols used in DFD Diagram:
• Rectangle:- To represent an external entity.
• Circle:- Represent a process or transform that is applied to data or control and
change it in some way.
• Arrow:- It links one or more data items.
• Double line:- It represents a data store.

34
LEVEL -0 DFD DIAGRAMS OF CLMS:

It should depict the entire system as single bubble along with all the
related entities processing with the system. Only one bubble should be
refined at a time. A level 0 DFD is also called a fundamental system.

Explanation:- Here we use only a bubble as it is 0-level DFD.In this


bubble, we show the process of CLMS System how it works on user
demands, how it receive commands from user and how return output

N O D E #
F E T C H D E T A I L S
A D M I N D A T A B A S E
C L M S

H A R D W A R E D E T A I L

Fig 4.3 0-LEVEL DFD

to the user.First of all user provide a Node number as input to the CLMS
system. It process on the node number and and obtains the desired result
from the database and provides those information back to the admin .It
provide information in compact form and just provides the basic idea
regarding the working of different components involved in the system.

LEVEL -1 DFD DIAGRAM OF CLMS:


Level 1 DFD diagram is the extended version of 0 level.It contains more
information than Level 0 diagram.Level 0 is abstract level which use only
one bubble.Here we can use 5-6 bubbles to represent different process.

35
D A T A B A S E

R E Q U E S T U S E R N A M VE E & R IP F A Y S S W O R D

C O F I R M A U T H E N T I C A T I O N
C L M S F E T C H D E T A I L
A D M I N
E N T E R N O D E #

R E Q U E S T N O D E N U M B E R

H A R D W A R E D E T A I L

Fig4.2 1-Level of DFD Diagram of CLMS SERVER

Explanation:-
Here we use 2 bubble-
• one is to represent CLMS process
• other is used to represent the verification process by system for user
authentication
.

There are two entity here-


• One is user who is the programmer having all the authorization of using the
system.
• Other is the stored Database

Arrow represent the flow of data from one entity to process and from process
to another.

Data on the arrow gives the information about data means what type of data
is flowing from one process to another or to entity.

This diagram is the extended version of 0 level DFD diagram.

36
First of all,when a user will run this application, it prompt user to provide user
authentication to system. Then user will provide a user name and password
which will be verified by the CLMS from the database and if the information
Then this application will open a application screen and demands for a node
number of the client whose system information is required by the admin. CLMS
then checks the database for the hardware information of the required client
node and fetch it from the database to put it in front of the admin.

4.3 Use-case Diagram


A use case diagram model the dynamic aspects of a system.
A use diagram contains:
1.Use cases: Description of the set of actions that a system performs yielding an
observable result to an actor.It will represent in ovals. Labels with ovals
represent the functions of the system.
2. Actors: Set of roles that user of use cases play when interacting with the use
cases.
3. Relationships between an actor and a use case is illustrated with a single
line.

Use case Diagram of CLMS:-


Here Admin is an actor who performs all the actions on this application. He has
all the authority to run this application. When a user run this application it request
for authentication i.e username and password. After authentication admin
provides node number of the system whose hardware configuration information
he requires. CLMS Server (actor) then provides hardware detail of that specific
node to the admin. If log file is desired then CLMS provides log file.

37
Fig 4.5 USE –CASE DIAGRAM OF CLMS server

5 Designing of the CLMS

5.1 Specific Requirements

The designer would be specified with each and every aspect of the requirement
demanded in the development of CLMS.CLMS Client should fetch the complete
required data properly and store them in a well defined manner in the database
such that it is easily accessible by the server application. Comparison should be
performed precisely so that a perfect log file of any update and modification can
be tracted easily and accurately.CLMS server should have user friendly GUI
application screen so that the user can easily adapt with the working of the
system and view of the screen provided by it should be well managed and easily

38
understandable.It should have well defined query attached with GUI components
to obtain the correct data from the database without any error.

5.2 User Characteristics

User Category Sub Category Functionality

A Programmer has all


the administrative
USER PROGRAMMER powers to run this
application.

5.3 Design and Implementation Constraints

1. CLMS is limited to work on Microsoft Windows Environment only. it will not


work on any other operating system.
2. CLMS requires System must have .Net Framework
3. CLMS system requires SQLServer 2003/2005 installed on the server system.

5.4 Assumptions and Dependencies

• The users have the basic knowledge of computer.


• The Computer in which this application is to be installed should be compatible
with .Net framework.
• The user should have the knowledge of the computer hardware and there
different attributes.
• CLMS development requires a good knowledge of Operating System and WMI
architecture of the windows.
• For CLMS application, the users should have the knowledge of c# Language.

39
• For the CLMS application, the users should have the knowledge of developing a
database using SQLServer 2003/2005 and mauplation language syntax of the
database.
Simple knowledge of Networking

5.5 Constraints

1. CLMS is limited to work on Microsoft Windows Environment only. it will not


work on any other operating system.
2. CLMS requires System must have .Net Framework
3. CLMS system requires SQLServer 2003/2005 installed on the server system.

5.6 Interfaces

In this application, CLMS client will have no user interface since it doesnot require any
inputs from user it just works to fetch information from operating system itself.CLMS
server will have a user interface application screen through which a user will interact
with the application and view the result of its query over the screen. The Graphical user
interface is very simple as it contain controls like Buttons,Labels,Textboxes etc. which
makes GUI more user friendly.

Login Screen:
This is the login screen for users on client side & will be controlled by ILM Client running
on client PC.
User Management Screen:
It allows admin to interact with system to view users information of any system node
connected etc.
Data Log screen:
It allows user to view the changes in any configuration of any system as recorded by the
application.

40
5.6.1 Hardware Interfaces
The application requires interfacing between server and client nodes.To establish
interfacing among these system it requires any networking devices like switch or
hub and lan wire to establish connection among these system.

5.6.2Software Interfaces
CLMS system uses SQLserver 2005 to store and retrieve data and it uses
executables file developed using Visual Studio 2008 on C# language

5.7 Product Functions

The CLMS Client is scheduled application that is coded to executed the specific code in
it to obtain the details of the hardware configuration of the system in whichit is running.
It will fetch information regarding processor, motherboard, HDD, Keyboard, pointing
device, network card etc

A CLMS CLIENT is capable of doing the following.

• Fetching system Hardware configuration of the system at regular interval.


• Create a file of these information and stored them in the system.
• Comparing the data sored in earlier saved file for any changes.
• Storing the fetched data into the database present at server.

The CLMS Server is interacting application that acts as interface between the
user and the system using GUI application screen .It is coded to obtain the
queried data from the database and represent it over the management screen.

A CLMS Server is capable of doing the following:

• Interface between user and application.

41
• Obtain the data store in database as per the user query
• Develop a synchronized log file that depicts the changes in any node

5.8Design Methodology

Waterfall model with feedback is being used for the development or the project.
Various phases of this model as shown in figure

Figure: 5.6.1

This project is developed using C#.Net. This product is accomplished with the
facility of user requirement. It provides the user friendly interface which is very
easy to understand. It provides the various facilities to the user.

6.DataBase:

42
Master Database of CLMS have many tables in it .Table architecture of the
CLMS Database is shown in the below figure:

Fig 6.1 CLMS Database Architecture

7.OUTPUT

7.1 Login Screen

43
Fig 7.1 Login Screen

This is the login screen of our application computer lab management system.
It contains 1 button and two textboxes

1. Login (button)

Login Panel: - In Login Panel Username and Password are provided by the

user to login in the CLMS server application

44
7.2 User Management Screen:

Fig7.2 User Management Screen


Manual Update:
When we click on the manual update button in the application, then the manual
update window will open and we can enter the data manually .

Inventory:
When we click on the inventory button in the application, then it will show a form
from where we can enter and see the inventory details of the lab..

Node:
When we click on the node button in the application, then it will show the
information of the node number entered.

User:

When we click on the user button in the application, a form will open from where
admin can create the user for a specific lab.

45
7.3 Log:

When we click on the log button in the application, it will show the log detail of the
node entered by the user.

Manual Update

Fig 7.3 LOG FORM

Explanation:-
When we select a the manual update option form the previous form we will get
the list of all the component we want to update and by clicking them we can get
the list from the database and can update manually and then update the
database..

46
7.4 Inventory:

Fig 7.4 Inventory


Explanation: - When we click on the inventory button we will get this form
opened where we will have two button of add and update from add we can add
new item into the database and from the update we will update the existing data
in the database.

7.5 Inventory Update:


47
Fig 7.5 Inventory Update
Explanation: - When we click on the update button in the inventory form this
form will be opened and the data from the database is picked and we can modify
the data and update by clicking on the update button.

48
7.6 Node:

Fig 7.6 Node

Explanation: -

When we click on the node button, present on the main form then we will get the
above form from which we can see the information about all the component of
the node and by clicking on any one of them we can get the information which
was stored on the database by the Clint application.

49
7.7 Create User:

Fig 7.7 Create User


Explanation:-

When we click on the add user button we get the above form by the help of
which the admin can add the user to a specified node and can assign them the
Password

8. Results:-

A console application is installed on the client side (node) which send all the
information to the server database.
A GUI application runs on the server from where we can see all the data and
can modify the data.

9. Discussion:-

50
The purpose of discussion and audits is to specify that the evidence of work generated
is adequate to ensure compliance with project and contract requirements. Audits with
discussion will occur at the end of each phase. The discussion will be conducted by the
supervisory committee prior to any baseline release of executable code. The discussion
will ensure that:

(1) The code has been tested and meets module specifications
(2) That any changes to applicable software module design documents have been
identified.
(3) That appropriate validation tests have been run.
(4) That the functionality of the baseline is documented.
(5) That application design documentation complies with the plans and procedures.
(6) That tools and techniques used to produce and validate the application are identified
and controlled.

10. Application and Future Direction:-


CLMS is a project developed for the surveillance of computers in a computer lab. CLMS
application can be implemented in the school as well as college lab where there is a
need of keeping all the information about system configuration as this application
maintains a database for the system hardware configuration.it can be also used for
maintaining lab inventory. In future it can also be upgraded to keep vigilance of the
system

11.Testing
11.1 Overview
Software testing is an investigation conducted to provide stakeholders with information
about the quality of the product or service under test. Software testing also provides an
objective, independent view of the software to allow the business to appreciate and
understand the risks at implementation of the software. Test techniques include, but are

51
not limited to, the process of executing a program or application with the intent of finding
software bugs.
Software testing was performed for validating and verifying that CLMS:

• Meets the business and technical requirements that guided its design and
development;

• Works as expected; and

• Can be implemented with the same characteristics.

11.2Testing Methods
Following methods were proposed for testing Project CLMS

11.2.1Unit Testing
Unit testing is a software verification and validation method in which a programmer tests
if individual units of source code are fit for use. A unit is the smallest testable part of an
application. In procedural programming a unit may be an individual function or
procedure.
Ideally, each test case is independent from the others: substitutes like method stubs,
mock objects, fakes and test harnesses can be used to assist testing a module in
isolation. Unit tests are typically written and run by software developers to ensure that
code meets its design and behaves as intended. Its implementation can vary from being
very manual (pencil and paper) to being formalized as part of build automation.

11.2.2Alpha Testing
Alpha testing is simulated or actual operational testing by potential users/customers or
an independent test team at the developers' site. Alpha testing is often employed for off-
the-shelf software as a form of internal acceptance testing, before the software goes to
beta testing.

52
11.2.3Beta Testing
Beta testing comes after alpha testing. Versions of the software, known as beta
versions, are released to a limited audience outside of the programming team. The
software is released to groups of people so that further testing can ensure the product
has few faults or bugs. Sometimes, beta versions are made available to the open public
to increase the feedback field to a maximal number of future users.

11.3 Test Report


11.3.1 API Test
For testing the External APIs prototypes were created and regressively tested during the
early life of the project. Both the APIs were found correct and performed the functions
for which they were used without any error.

11.3.2 Unit Tests


Visual Studio 2008's Inbuilt unit testing features were used for Unit testing. A test project
was made for the Project CLMS and all the important functions were subjected to Unit
Testing. The details of all the test cases and input data are beyond the scope of this
document. Results of the tests are summarized bellow -
Functions Under Unit Testing – 32
Success in First Round – 24
Failure in First Round – 8
Bugs Found after First Round – 6
Bugs Corrected After first Round – 6

Success in Second Round – 29


Failure in Second Round – 3
Bugs Found in Second Round – 1
Bugs Corrected – 1

53
Success in Third Round – 32
Failure in Third Round – 0
Total Rounds of Testing – 3
Total Bugs – 8
Resurfacing Bugs – 1 (In second and First round)
Final Success – 100%

11.3.3 Alpha Test


After the Unit testing the software was subjected to Alpha testing. The enviroment for
Alpha testing was as follows -

• CPU

• Family - AMD Turion

• Architecture - x64

• Clock - 2.1 Ghz

• RAM

• 2.3 GB

• Operating System

• Microsoft Vista Home Premium

• .NET Framework

• .NET Framework 3.5 SP1

The software worked as per the requirements under above conditions no exceptional
CPU/RAM/Network use was found. The system behaved normally. CLMS was found to
fulfill all the functional/non-functional requirements mentioned in Software Requirement
Specifications V1.0[SRS].

Following were the Systems stats under load conditions -


CPU Use – 17%

54
RAM Use – 46 MB

Under normal Run, Following were the system stats-


CPU Use – 8%
RAM Use – 34 MB

12. Source Code of CLMS Client:


using System;
using System.Collections.Generic;
using System.Text;

using System.Management;
using System.Data.Sql;
using System.Data.SqlClient;

namespace ConsoleApplication3
{
class Program
{
//Node Validation
#region Valid
public static Boolean Valid(int node)
{
SqlConnection conn = new SqlConnection();
conn.ConnectionString = "Data Source=.;Initial
Catalog=CLMS;Persist Security Info=True;User ID=sa;Password=dell";
conn.Open();
string sqlstring = "Select Nodevalue from Node where Nodevalue='"
+ node + "'"; ;
SqlCommand comm = new SqlCommand(sqlstring, conn);
SqlDataReader reader = comm.ExecuteReader();
if (reader.Read())
return true;

else
return false;

#endregion
//Main Function

static void Main(string[] args)


{
Console.WriteLine("Assign a Node Number to the System");
int node = Convert.ToInt32(Console.ReadLine());

ConnectionOptions con = new ConnectionOptions();


ManagementScope ms = new ManagementScope("\\\\localhost", con);

55
SqlConnection conn = new SqlConnection();
conn.ConnectionString = "Data Source=.;Initial
Catalog=CLMS;Persist Security Info=True;User ID=sa;Password=dell";
conn.Open();

Boolean result = Valid(node);


if (result == true)

{
Console.WriteLine("THIS NODE IS PRESENT IN THE NETWORK ");
update(node);
Console.ReadLine();
}
else
{
{
SqlCommand cmd = new SqlCommand("insert into
Node(Nodevalue) values ('" + node + "')", conn);
cmd.ExecuteNonQuery();
}

#region ComputerSystem
ObjectQuery oq = new ObjectQuery("select *from
Win32_ComputerSystem");
ManagementObjectSearcher mos = new
ManagementObjectSearcher(ms, oq);
ManagementObjectCollection moc = mos.Get();
foreach (ManagementObject mo in moc)
{
Console.WriteLine("**************Computer
System*****************\n");
Console.WriteLine("Name :{0}", mo["Name"]);
Console.WriteLine("Manufacturer :{0}",
mo["Manufacturer"]);
Console.WriteLine("Model :{0}", mo["Model"]);
Console.WriteLine("WorkGroup :{0}",
mo["WorkGroup"]);
Console.WriteLine("UserName :{0}",
mo["UserName"]);
Console.WriteLine("TotalPhysicalMemory:{0}",
mo["TotalPhysicalMemory"]);
Console.ReadLine();
SqlCommand cmd = new SqlCommand("insert into
ComputerSystem
(Node,Name,Manufacturer,Model,Workgroup,Username,TotalPhysicalMemory) values
('" + node + "','" + mo["Name"] + "','" + mo["Manufacturer"] + "','" +
mo["Model"] + "','" + mo["WorkGroup"] + "','" + mo["Username"] + "'," +
mo["TotalPhysicalMemory"] + ")", conn);
cmd.ExecuteNonQuery();
}
#endregion

#region Processor
//Processor Query

56
oq = new ObjectQuery("select *from Win32_Processor");
mos = new ManagementObjectSearcher(ms, oq);
moc = mos.Get();
foreach (ManagementObject mo in moc)
{
Console.WriteLine("**************PROCESSOR
INFO*****************\n");
Console.WriteLine("Name :{0}", mo["Name"]);
Console.WriteLine("ProcessorType :{0}",
mo["ProcessorType"]);
Console.WriteLine("ProcessorID :{0}",
mo["ProcessorID"]);
Console.WriteLine("Manufacturer :{0}",
mo["Manufacturer"]);
Console.WriteLine("MaxClockSpeed :{0}",
mo["maxClockSpeed"]);
Console.WriteLine("Architecture :{0}",
mo["Architecture"]);
Console.WriteLine("Description :{0}",
mo["Description"]);
Console.WriteLine("Family :{0}", mo["Family"]);
Console.WriteLine("NumberOfCores :{0}",
mo["NumberOfCores"]);
Console.WriteLine("UniqueID :{0}", mo["UniqueID"]);
Console.WriteLine("Status :{0}", mo["Status"]);
Console.ReadLine();
SqlCommand cmd = new SqlCommand("insert into
Processor(Node,Name,Manufacturer,ProcessorType,ProcessorID,MaxClockSpeed,Arch
itecture,Description,Family,NumberOfCores,UniqueID,Status) values ('" + node
+ "','" + mo["Name"] + "','" + mo["Manufacturer"] + "','" +
mo["ProcessorType"] + "','" + mo["ProcessorID"] + "','" + mo["MaxClockSpeed"]
+ "','" + mo["Architecture"] + "','" + mo["Description"] + "','" +
mo["Family"] + "','" + mo["NumberOfCores"] + "','" + mo["UniqueID"] + "','" +
mo["Status"] + "')", conn);

cmd.ExecuteNonQuery();

#endregion

#region PhysicalMemory
//HARDDRIVE QUERY
oq = new ObjectQuery("select *from Win32_PhysicalMemory");
mos = new ManagementObjectSearcher(ms, oq);
moc = mos.Get();
foreach (ManagementObject mo in moc)
{
Console.WriteLine("**************Physical
Memory***********************\n");

Console.WriteLine("Name :{0}", mo["Name"]);


Console.WriteLine("Manufacturer :{0}",
mo["Manufacturer"]);
Console.WriteLine("Model :{0}", mo["Model"]);

57
Console.WriteLine("SerialNumber :{0}",
mo["SerialNumber"]);
Console.WriteLine("InstallDate :{0}",
mo["InstallDate"]);
Console.WriteLine("Description :{0}",
mo["Description"]);
Console.WriteLine("Capacity :{0}",
mo["Capacity"]);
Console.WriteLine("Speed :{0}", mo["Speed"]);
Console.WriteLine("TypeDetail :{0}",
mo["TypeDetail"]);
Console.ReadLine();
SqlCommand cmd = new SqlCommand("insert into
PhysicalMemory values ('" + node + "','" + mo["Name"] + "','" +
mo["Manufacturer"] + "','" + mo["Model"] + "','" + mo["SerialNumber"] + "','"
+ mo["InstallDate"] + "','" + mo["Capacity"] + "','" + mo["Speed"] +
"','"+mo["TypeDetail"]+"')", conn);
cmd.ExecuteNonQuery();

#endregion

#region NetworkCard
////Network CARD
oq = new ObjectQuery("select *from Win32_NetworkAdapter\n");
mos = new ManagementObjectSearcher(ms, oq);
moc = mos.Get();
foreach (ManagementObject mo in moc)
{

int a = Convert.ToInt32(mo["DeviceID"]);
if (a == 4)
{
Console.WriteLine("**************NETWORK
CARD********************\n");

Console.WriteLine("Name :{0}", mo["Name"]);


Console.WriteLine("Manufacturer :{0}",
mo["Manufacturer"]);
Console.WriteLine("MACAddress :{0}",
mo["MACAddress"]);
Console.WriteLine("DeviceID :{0}",
mo["DeviceID"]);
Console.WriteLine("Status :{0}", mo["Status"]);
Console.WriteLine("AdapterType :{0}",
mo["AdapterType"]);
//Console.WriteLine("Description :{0}",
mo["Descripition"]);
Console.WriteLine("InstallDate :{0}",
mo["InstallDate"]);
Console.WriteLine("ProductName :{0}",
mo["ProductName"]);

//Console.WriteLine("{0}", mo[""]);

58
Console.ReadLine();

SqlCommand cmd = new SqlCommand("insert into


NetworkAdapter(Node,Name,Manufacturer,MACAddress,DeviceID,Status,AdapterType,
InstallDate) values ('" + node + "','" + mo["Name"] + "','" +
mo["Manufacturer"] + "','" + mo["MACAddress"] + "','" + mo["DeviceID"] + "','"
+ mo["Status"] + "','" + mo["AdapterType"] + "','" + mo["InstallDate"] +
"')", conn);
cmd.ExecuteNonQuery();

}
#endregion

#region DesktopMonitor
//DESKTOP MONITOR
oq = new ObjectQuery("select *from Win32_DesktopMonitor");
mos = new ManagementObjectSearcher(ms, oq);
moc = mos.Get();
foreach (ManagementObject mo in moc)
{
Console.WriteLine("**************DESKTOP
MONITOR********************\n");

Console.WriteLine("Name :{0}",
mo["Name"]);
Console.WriteLine("MonitorManufacturer :{0}",
mo["MonitorManufacturer"]);
Console.WriteLine("MonitorType :{0}",
mo["MonitorType"]);
Console.WriteLine("ScreenHeight :{0}",
mo["ScreenHeight"]);
Console.WriteLine("ScreenWidth :{0}",
mo["ScreenWidth"]);
Console.WriteLine("DisplayType :{0}",
mo["DisplayType"]);

Console.WriteLine("InstallDate :{0}",
mo["InstallDate"]);
Console.ReadLine();
SqlCommand cmd = new SqlCommand("insert into
DesktopMonitor(Node,Name,MonitorManufacturer,MonitorType,ScreenHeight,ScreenW
idth,DisplayType) values ('" + node + "','" + mo["Name"] + "','" +
mo["MonitorManufacturer"] + "','" + mo["MonitorType"] + "','" +
mo["ScreenHeight"] + "','" + mo["ScreenWidth"] + "','" + mo["DisplayType"] +
"')", conn);
cmd.ExecuteNonQuery();

}
#endregion

#region OperatingSystem
//OPERATING SYSTEM
oq = new ObjectQuery("select *from Win32_OperatingSystem");
mos = new ManagementObjectSearcher(ms, oq);

59
moc = mos.Get();
foreach (ManagementObject mo in moc)
{
Console.WriteLine("**************OPERATING
SYSTEM********************\n");

Console.WriteLine("Name :{0}",
mo["Name"]);
Console.WriteLine("Manufacturer :{0}",
mo["Manufacturer"]);
Console.WriteLine("OSType :{0}",
mo["OSType"]);
Console.WriteLine("Version :{0}",
mo["Version"]);
Console.WriteLine("WindowsDirectory :{0}",
mo["WindowsDirectory"]);
Console.WriteLine("InstallDate :{0}",
mo["InstallDate"]);
Console.ReadLine();
SqlCommand cmd = new SqlCommand("insert into
OperatingSystem(Node,Name,Manufacturer,OSType,Version,WindowsDirectory,Instal
lDate) values ('" + node + "','" + mo["Name"] + "','" + mo["Manufacturer"] +
"','" + mo["OSType"] + "','" + mo["Version"] + "','" + mo["WindowsDirectory"]
+ "','" + mo["InstallDate"] + "')", conn);
cmd.ExecuteNonQuery();

#endregion

#region KeyBoard

//KeyBoard
oq = new ObjectQuery("select *from Win32_KeyBoard");
mos = new ManagementObjectSearcher(ms, oq);
moc = mos.Get();
foreach (ManagementObject mo in moc)
{
Console.WriteLine("**************KeyBoard****************
****\n");

Console.WriteLine("Name :{0}",
mo["Name"]);
Console.WriteLine("Description :{0}",
mo["Description"]);
Console.WriteLine("Layout :{0}",
mo["Layout"]);
Console.WriteLine("NumberOfFuctionKeys :{0}",
mo["NumberOfFunctionKeys"]);
Console.WriteLine("Status :{0}",
mo["Status"]);
Console.WriteLine("InstallDate :{0}",
mo["InstallDate"]);
Console.ReadLine();
SqlCommand cmd = new SqlCommand("insert into
KeyBoard(Node,Name,Description,Layout,NumberOfFunctionKeys,Status,InstallDate

60
) values ('" + node + "','" + mo["Name"] + "','" + mo["Description"] + "','"
+ mo["Layout"] + "','" + mo["NumberOfFunctionKeys"] + "','" + mo["Status"] +
"','" + mo["InstallDate"] + "')", conn);
cmd.ExecuteNonQuery();

#endregion

#region PointingDevice
//PointingDevice
oq = new ObjectQuery("select *from Win32_PointingDevice");
mos = new ManagementObjectSearcher(ms, oq);
moc = mos.Get();
foreach (ManagementObject mo in moc)
{
Console.WriteLine("**************PointingDevice**********
**********\n");

Console.WriteLine("Name :{0}",
mo["Name"]);
Console.WriteLine("Manufacturer :{0}",
mo["Manufacturer"]);
Console.WriteLine("NumberOfButtons :{0}",
mo["NumberOfButtons"]);
Console.WriteLine("PointingType :{0}",
mo["PointingType"]);
Console.WriteLine("Status :{0}",
mo["Status"]);
Console.WriteLine("DeviceInterface :{0}",
mo["DeviceInterface"]);
Console.WriteLine("HardwareType :{0}",
mo["HardwareType"]);
Console.WriteLine("InstallDate :{0}",
mo["InstallDate"]);
Console.ReadLine();
SqlCommand cmd = new SqlCommand("insert into
PointingDevice(Node,Name,Manufacturer,NumberOfButtons,PointingType,Status,Dev
iceInterface,HardwareType,InstallDate) values ('" + node + "','" + mo["Name"]
+ "','" + mo["Manufacturer"] + "','" + mo["NumberOfButtons"] + "','" +
mo["PointingType"] + "','" + mo["Status"] + "','" + mo["DeviceInterface"] +
"','" + mo["HardwareType"] + "','" + mo["InstallDate"] + "')", conn);
cmd.ExecuteNonQuery();

#endregion

#region CDROMDrive
//CDROMDrive
oq = new ObjectQuery("select *from Win32_CDROMDrive");
mos = new ManagementObjectSearcher(ms, oq);
moc = mos.Get();
foreach (ManagementObject mo in moc)
{

61
Console.WriteLine("**************CDROMDRIVE**************
***\n");
Console.WriteLine("Name :{0}", mo["Name"]);
Console.WriteLine("Manufacturer :{0}",
mo["Manufacturer"]);
Console.WriteLine("InstallDate :{0}",
mo["InstallDate"]);
Console.WriteLine("SCSIPort :{0}",
mo["SCSIPort"]);

Console.ReadLine();
//SqlCommand cmd = new SqlCommand("insert into
CDROMDrive(Node,Name,Manufacturer,SCSIPort,InstallDate) values ('" + node +
"','" + mo["Name"] + "','" + mo["Manufacturer"] + "'," + mo["SCSIPort"] +
",'" + mo["InstallDate"] + "')", conn);
//cmd.ExecuteNonQuery();

}
#endregion
}
}

static void update(int node)


{ ConnectionOptions con = new ConnectionOptions();
ManagementScope ms = new ManagementScope("\\\\localhost", con);

SqlConnection conn = new SqlConnection();


conn.ConnectionString = "Data Source=.;Initial
Catalog=CLMS;Persist Security Info=True;User ID=sa;Password=dell";
conn.Open();
#region ComputerSystem
ObjectQuery oq = new ObjectQuery("select *from
Win32_ComputerSystem");
ManagementObjectSearcher mos = new
ManagementObjectSearcher(ms, oq);
ManagementObjectCollection moc = mos.Get();
foreach (ManagementObject mo in moc)
{
//Console.WriteLine("**************Computer
System*****************\n");
//Console.WriteLine("Name :{0}",
mo["Name"]);
//Console.WriteLine("Manufacturer :{0}",
mo["Manufacturer"]);
//Console.WriteLine("Model :{0}",
mo["Model"]);
//Console.WriteLine("WorkGroup :{0}",
mo["WorkGroup"]);
//Console.WriteLine("UserName :{0}",
mo["UserName"]);
//Console.WriteLine("TotalPhysicalMemory:{0}",
mo["TotalPhysicalMemory"]);
//Console.ReadLine();
SqlCommand cmd = new SqlCommand("insert into
PComputerSystem

62
(Node,Name,Manufacturer,Model,Workgroup,Username,TotalPhysicalMemory) values
('" + node + "','" + mo["Name"] + "','" + mo["Manufacturer"] + "','" +
mo["Model"] + "','" + mo["WorkGroup"] + "','" + mo["Username"] + "'," +
mo["TotalPhysicalMemory"] + ")", conn);
cmd.ExecuteNonQuery();
string name = mo["Name"].ToString();
string Man = mo["Manufacturer"].ToString();
string Mod = mo["Model"].ToString();
string wg = mo["WorkGroup"].ToString();
string un = mo["UserName"].ToString();
string tpm = mo["TotalPhysicalMemory"].ToString();

string dname="";
string dMan="";
string dMod="";
string dwg="";
string dun="";
string dtpm="";

string sqlstring;
sqlstring = "Select *from ComputerSystem where Node= "+
node +" ";

SqlCommand comm = new SqlCommand(sqlstring, conn);


SqlDataReader reader;
reader = comm.ExecuteReader();
while (reader.Read())
{
dname = reader[1].ToString();
dMan = reader[2].ToString();
dMod = reader[3].ToString();
dwg = reader[4].ToString();
dun = reader[5].ToString();
dtpm = reader[6].ToString();

}
reader.Close();
Console.WriteLine(dMan);
Console.WriteLine(Man);
if ((name == dname) )//&& (Man == dMan)) && (dMod ==
Mod)&& (dwg == wg) && (dun == un) && (dtpm == tpm))
{
Console.WriteLine("no change");

}
else
{
//reader.Close();
Console.WriteLine("Change exist");
string Detail = "Processor is updated";
string time = "System Time";
SqlCommand cmd1 = new SqlCommand("insert into
LogTable values ('" + node + "','" + Detail + "','" + time + "')", conn);
cmd1.ExecuteNonQuery();

63
}
#endregion

}
}

13.Refernces:

64
Books:

Object Oriented Programming with C++ written by E BALAGURUSAMY.


C# premier written by STANLEY B.LIPPMAN
DataBase Management by H.Kroth
BLACK BOOK OF .NET
NIIT courseware

Websites:
• www.c#corner.com
• www.msdn.com
• www.devdevelopers.com
• www.dotnetspider.com
• www.codeproject.com

65

Você também pode gostar