473,325 Members | 2,870 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Interfacing a Window Service

Hi,

I'm working on a window service and i want to give an interface to it. What can be the best approach to get this done.

Can i include a Form, when the user starts the service then gives some parameters only on the start. then the service is started and continue its work.

No need to give values on run-time.
Looking for best approaches.....................
Apr 10 '08 #1
1 875
balame2004
142 100+
Hi,

I'm working on a window service and i want to give an interface to it. What can be the best approach to get this done.

Can i include a Form, when the user starts the service then gives some parameters only on the start. then the service is started and continue its work.

No need to give values on run-time.
Looking for best approaches.....................

Hi,


There are two different approaches to show an interface while windows service service is running.

1. Create a dll with a public method which invokes show method of a windows form and call the public method from OnStart event of windows service(Also add reference to the dll) .
2.Create a windows application and start it while windows service is being started and stop it while windows service is stopped.

Here is the sample code for the second option.

//Global variable
private System.Diagnostics.Process process;

---
---
---

protected override void OnStart(string[] args)
{
process = System.Diagnostics.Process.Start("WindowsApplicati on2.exe");
}
protected override void OnStop()
{
process.Kill();
}


Regards,
Balaji U
Apr 11 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

19
by: Adam Short | last post by:
I am trying to write a routine that will connect a .NET server with a classic ASP server. I know the following code doesn't work! The data is being returned as a dataset, however ASP does not...
2
by: headware | last post by:
I'm relatively new to ASP.NET and ADO.NET, but I have a basic design question regarding the use of web services and APS.NET applications. Right now we have an application that uses web services to...
1
by: Sigrid | last post by:
Hi! I'm trying to develop a .net application (xml web service client, using SoapHttpClientProtocol), but i can't get any response from xml web service (php, NuSOAP), server url is:...
2
by: abhay | last post by:
hi,i m interfacing gsm modem to my microcontroller.i need to send sms through it. i am using AT commands for that.the command to send sms (AT+ CMGS) terminates with ctrl-Z.now in my program i hav...
7
by: =?Utf-8?B?Vmlua2k=?= | last post by:
public void sendKeysTest() { Process myProcess = Process.Start(@"C:\winnt\system32\cmd.exe"); SetForegroundWindow(myProcess.Handle); if (myProcess.Responding) SendKeys.SendWait("{ENTER}");...
0
by: henkya | last post by:
Language Used: C# Project Typed: Setup Project (for .NET Window Service) Hi Bump into this issue and seriously have a hunch that this is a bug in the .NET setup project. These are the scenario:...
0
by: alfie196 | last post by:
Hi, I am trying to write an application that can retrieve information from a window in another app. So far i believe i need to get the window handle of the window i want data from, for this i am...
2
by: gray d newbie | last post by:
Greetings All, This is my first time creating a Window Service and I am having this error message when I try to start my window service (currently known as Service1). Below is my code for Window...
10
by: happyse27 | last post by:
Hi All, I got this apache errors(see section A1 and A2 below) when I used a html(see section b below) to activate acctman.pl(see section c below). Section D below is part of the configuration...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.