473,473 Members | 1,917 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Coding Services

Hi !

I wan't to code a service which will be installed on some clients in our
network.
The service should have the following features :

- Scan all properties of the Client (Hardware, Software etc)
- Create a log (eg. logfile.txt)
- Optional : Insert the data directly in an SQL-Database
- All these functions should occur, when a Timer elapsed or when I send a
command to do this.

My problem : Up to the manual command all functions have been implemented.
So, my question is : How can i communicate with these services to do things
when i want them to do ?
For better understanding : The service has started succesfully and is now
waiting for commands like "Start Scan"

Thanks !!!!!

Christoph
Nov 20 '05 #1
4 1243
H Ghrisoph,

In my opinion is all you ask as samples in the resource kit

Using WMI
The service sample has a part for updating the logfile
Data Entry sample shows how to update the database.
And there are more timer samples.

See the links bellow

I hope this helps?

Cor

VB.net Resource kit
http://msdn.microsoft.com/vbasic/vbrkit/default.aspx

And if you have problems installing the resource kit
http://msdn.microsoft.com/vbasic/vbr...q/#installvdir

Another resource for learning is the Quick Starts
http://samples.gotdotnet.com/quickstart/
I hope this helps a little bit?

Cor

Hi !

I wan't to code a service which will be installed on some clients in our
network.
The service should have the following features :

- Scan all properties of the Client (Hardware, Software etc)
- Create a log (eg. logfile.txt)
- Optional : Insert the data directly in an SQL-Database
- All these functions should occur, when a Timer elapsed or when I send a
command to do this.

My problem : Up to the manual command all functions have been implemented. So, my question is : How can i communicate with these services to do things when i want them to do ?
For better understanding : The service has started succesfully and is now
waiting for commands like "Start Scan"

Thanks !!!!!

Christoph

Nov 20 '05 #2
Hi Cor !

thanks for answering my question.
But my only problem is to "trigger" my service to start the scan.
All other functions are already implemented.

Christoph
Nov 20 '05 #3
Hi Chrisoph,

I thought that that was as well in the service sample from the resource kit,
however from that one I am not completly sure.

Cor

thanks for answering my question.
But my only problem is to "trigger" my service to start the scan.
All other functions are already implemented.

Christoph

Nov 20 '05 #4
Christoph,
The easiest way to have a service accept a "command" to do something is to
override the ServiceBase.OnCustomCommand method and have it call the same
procedure your Timer.Elapsed event handler calls.

Then you can use ServiceController.ExecuteCommand to invoke this custom
command.

Note I would probably define an Enum of CustomCommands that my service
supported so its easier to keep track of them. A custom command for
OnCustomCommand is an integer between 128 & 256, which also means you can
have multiple custom commands defined.

Remember that ServiceController can control services on your local machine
as well as services on remote machines. Note you may need to configure the
various machines to allow remote control of services.

An alternative, more flexible method, which also entails more work, is to
enable your service for .NET Remoting. You could either make it a .NET
Remoting Server, in which case you call a method to have it perform some
action, or a .NET Remoting Client, and possible handle an "update data
event" on your server remoting object that says to update data...

Both of the custom commands & remoting with a service are discussed in
Matthew MacDonalds book "Microsoft Visual Basic .NET Programmer's Cookbook"
from MS Press.

Hope this helps
Jay
"Christoph Duesmann" <c.********@web.de> wrote in message
news:O4**************@TK2MSFTNGP12.phx.gbl...
Hi !

I wan't to code a service which will be installed on some clients in our
network.
The service should have the following features :

- Scan all properties of the Client (Hardware, Software etc)
- Create a log (eg. logfile.txt)
- Optional : Insert the data directly in an SQL-Database
- All these functions should occur, when a Timer elapsed or when I send a
command to do this.

My problem : Up to the manual command all functions have been implemented. So, my question is : How can i communicate with these services to do things when i want them to do ?
For better understanding : The service has started succesfully and is now
waiting for commands like "Start Scan"

Thanks !!!!!

Christoph

Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Scott Meddows | last post by:
Does anyone know of a document that Microsoft produces that has the suggested coding standards for naming tables in a Database, fields in a database, objects in a VB project and so on? Maybe one...
4
by: Dotnetjunky | last post by:
Hi, So far, I've found tons of documents describing recommended coding standards for C#, but not a single piece on VB.NET yet. Anybody here knows such a coding standards guideline on VB.NET...
3
by: Dan Schaertel | last post by:
Does anybody have a good VB coding standards documnet? I need to generate one and I am looking for examples. Thanks email: dschaertel@hotmail.com
2
by: david | last post by:
I have written the Web Services in VBaic .Net. One function interface: DataSet GetAllPatients() which will be called in remote client and return DataSet. I have written the clients by using both...
52
by: Sergey Zuyev | last post by:
Hello All I work at software company and we are having a really big discussion about coding styles and it seems that more people prefer statement 1 to statement2 , which was a big surprise to...
3
by: Manuel Alves | last post by:
Hi all, I've got a windows service that depends on some other services. On the project installer I state this by using: Me.myService.ServicesDependedOn = New String() {"Print Spooler", "Net...
1
by: Gale Coleman - LSND | last post by:
ASP, VBscript, IIS 6, Access database Hello, I have a form page that people fill out and push submit. When they push submit, the information is stored in a database in two different tables....
0
by: pat | last post by:
CodeCheck Coding Standard's Support As a free service to our customers we offer support in developing "rule-files" for automating corporate coding standards. If you have a coding standard that...
1
by: Jennifer Jazz | last post by:
My question is regarding the mapping of Class diagram to the C++ coding. There are 3 realtions in Class diagram 1) Assosication 2) Composition 3) Aggregation (Weak Composition). ...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.