windows-services

SpecialFolder.MyDocuments giving correct value in a console application but not on a Windows Service

眉间皱痕 提交于 2019-11-30 17:22:11
问题 I have a windows service running on my machine. When I do a Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments) it gives me empty string but when I do the same thing in a console application it gives me the correct location of my MyDocuments folder. Any ideas as to why it might be happening? 回答1: That is because when you run the application as a Console you are running signed in to the computer as you, the user, and can therefore access your "My Documents". When the

What is the benefit of developing the application as a windows service?

有些话、适合烂在心里 提交于 2019-11-30 17:09:53
I am going to develop an application which will process online data (comming through socket) and it does not need any user interaction. I am thinking of a simple console application, but what about windows service does it provide extra benefit? (I know windows service does not need user logged in to run the service but I am asking about extra benefit) VonC On the top of my head: You can control the user (and the rights associated with this user account) which starts the process an Automatically started process means the desktop need to be on, not user logged, for the service to run a policy on

How to determine Windows.Diagnostics.Process from ServiceController

ε祈祈猫儿з 提交于 2019-11-30 16:51:24
问题 This is my first post, so let me start by saying HELLO! I am writing a windows service to monitor the running state of a number of other windows services on the same server. I'd like to extend the application to also print some of the memory statistics of the services, but I'm having trouble working out how to map from a particular ServiceController object to its associated Diagnostics.Process object, which I think I need to determine the memory state. I found out how to map from a

Updated: Interacting with the user on the windows logon screen

别来无恙 提交于 2019-11-30 16:48:44
@UPDATE: OK FOR ANYONE ELSE WHO IS SEEKING ADVICE ON THIS ISSUE... So far, the best thing i have found is to download yourself a cpy of pGina ( http://www.pgina.org/ ) and for 2k/xp modify the GINA, and for vista/win7 you will need to create custom login credentials (pGina have the tools/samples to interface with the vista/win7 architecture). to confirm -- it appears that this is what Novell are doing with vista/win7 rather than the traditional method of replacing the GINA (like in 2k/xp) If anyone else comes up with a way to run an application on the logon screen in win7 please post it.

Running Selenium RC as a Windows Service

偶尔善良 提交于 2019-11-30 16:43:35
I'm trying to get Selenium setup to run as a windows service. It seems to be okay but, then does not seem to run properly. Using the windows toolkit I have done: "C:\Program Files\Windows Resource Kits\Tools\instsrv.exe" SeleniumRC "C:\Program Files\Windows Resource Kits\Tools\srvany.exe" -a [SeleniumUser] -p [SeleniumUserPass] Saved the following as a.reg file (and then double clicked it) Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SeleniumRC\Parameters] "Application"="java.exe" "AppDirectory"="C:\\Program Files\\selenium-server-1.0.3"

WCF windows service as scheduled service

不羁岁月 提交于 2019-11-30 16:21:41
问题 I've a .net WCF windows service running on an app server which keeps monitoring a folder for xml files. How do I make this service run only at a particular time (01.00 hours) everyday ? Thanks. 回答1: Is your service a real service or just a WCF application which monitors the XML folder? In case your WCF service is just a normal application the easiest way is to use the Scheduled Tasks functionality in Windows (Found in Control Panel). Just have the application check the folder on startup and

WCF windows service as scheduled service

喜你入骨 提交于 2019-11-30 16:08:31
I've a .net WCF windows service running on an app server which keeps monitoring a folder for xml files. How do I make this service run only at a particular time (01.00 hours) everyday ? Thanks. Is your service a real service or just a WCF application which monitors the XML folder? In case your WCF service is just a normal application the easiest way is to use the Scheduled Tasks functionality in Windows (Found in Control Panel). Just have the application check the folder on startup and set a scheduled task which starts the application at whatever time you want. If the target application is a

Howto setup a Daemon implementation as windows service

风格不统一 提交于 2019-11-30 16:08:15
I didn't find any really good example (actually I did not find a single example) on how to register a class that implements the org.apache.commons.daemon.Daemon interface as Windows service. Do I have to register this implementation using procrun? But than there doesn't seem to be a point in implementing the interface as procrun can register any program as windows service. Furthermore there seems to be a docu-bug on the procrun page ( http://commons.apache.org/proper/commons-daemon/procrun.html ): The description of the --StartMethod parameter states: Note: in jvm mode, the start method should

How to get the current number of interactive user sessions in Windows?

浪尽此生 提交于 2019-11-30 16:06:32
问题 I'm writing a Windows service that needs to know whether there are any users currently logged-on in the machine. So far I've tried Win32_LogonSession (WMI), and LsaEnumerateLogonSessions / LsaGetLogonSessionData (secur32.dll). Both work, and seem to return the same data, but they are too slow to update when a user log off: When the system starts, they return "0 interactive users". (OK) When I log on, they return "1 interactive user". (OK) But then when I log off, the number of users is kept

How to get the current number of interactive user sessions in Windows?

℡╲_俬逩灬. 提交于 2019-11-30 16:03:25
I'm writing a Windows service that needs to know whether there are any users currently logged-on in the machine. So far I've tried Win32_LogonSession (WMI), and LsaEnumerateLogonSessions / LsaGetLogonSessionData (secur32.dll). Both work, and seem to return the same data, but they are too slow to update when a user log off: When the system starts, they return "0 interactive users". (OK) When I log on, they return "1 interactive user". (OK) But then when I log off, the number of users is kept at 1. After a new log-on, the number is 2, and so on. Thus Win32_LogonSession nor