473,657 Members | 2,422 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Interfacing a Window Service

25 New Member
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 884
balame2004
142 New Member
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.Diagnost ics.Process process;

---
---
---

protected override void OnStart(string[] args)
{
process = System.Diagnost ics.Process.Sta rt("WindowsAppl ication2.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
9313
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 recognise datasets and requires a recordset. Can the datatypes be converted? At the Classic ASP end or .NET end? Can SOAP toolkit provide the conversion, can any toolkit provide a conversion? ...
2
2207
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 access the database layer. However, the code works in a pretty cumbersome and ungeneric way. Basically every query, update, and insert has its own function. So you see a lot of functions like webService.InsertCustomer(name, age, phone); or...
1
3239
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: http://dp.photopoint.ee/dp_server.php A call to web service method getBanner(int) with argument 1, getBanner(1),
2
15925
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 tried all ways to send ctrl-Z at end of my sms.but it takes this as a character or string only.also i tried with ascii value of ctrl-Z but of no use. i am able to see the transmitted commands on hyper-terminal through
7
8630
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}"); else
0
1908
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: - I have an existing Window-Service application written in C#, and was build following the general deploying Window-Service guideline (the Win-Service project has a Installer class that have ServiceProcessInstaller & ServiceInstaller that...
0
955
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 using the user32 FindWindow function. This does appear to return a handle but it differs from the one given when using spy++, can any one offer an explanation as to why? Assuming i have the handle for the correct window how do i find the handle of...
2
1730
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 Service and also the line which I suspected is the caused of the problem. Protected Overrides Sub OnStart(ByVal args() As String) Dim i As Integer i = Shell("\\202.186.196.128\c$\Inetpub\wwwroot\WebAdmin\Rewards\print.exe",...
10
6960
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 of section c. Not sure where went wrong as the web page displayed internal server error. Also, what is the error 543? and error 2114. Where to find the list of errors in websites as it is not the standard apache error. I could not find...
0
8411
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8838
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8513
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8613
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6176
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2740
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 we have to send another system
2
1969
muto222
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.