windows-services

CreateProcessAsUser doesn't draw the GUI

微笑、不失礼 提交于 2019-12-08 02:03:55
问题 I have a windows service running under "SYSTEM" account that checks if a specific application is running for each logged in user. If the application is not running, the service starts it (under corresponding user name). I'm trying to accomplish my goal using CreateProcessAsUser(). The service does start the application under corresponding user name, but the GUI is not drawn. (Yes, I'm making sure that "Allow service to interact with desktop" check box is enabled). System: XP SP3, language: C#

How to make a program not utilize 100% cpu?

戏子无情 提交于 2019-12-08 01:36:12
问题 There are 5 threads running in an infinite loop. 2 of them will send messages when queue is not empty. 4 of them will keep sending heartbeat within 5 minutes. 1 of them is to request data from another source. When it utilizes 100% of the CPU, I can not use any other applications in the window. The whole window becomes very slow. EDIT: can sleep be put after WaitOne? if(autoEvent.WaitOne()) { } else { } Thread.Sleep(100); Can sleep be put after subscriber.Recv() which is ZeroMQ ? all threads i

Configurable Windows Service - How and where to store configuration

╄→尐↘猪︶ㄣ 提交于 2019-12-07 18:45:25
问题 I created a C# application to manage data synchronization between an ERP and a CRM. This application reads a table every 500ms, and sends data via WebService to CRM. For the moment, I have two screens for my application : a first to configure connections (ERP's DB connection informations and CRM's URL and WS Token), a second with a start button to launch the loop thread. I know want my application to be nothing more than a windows service installer. What I want to do is to launch my

How to install a service with the delayed-auto startup type in Windows XP

帅比萌擦擦* 提交于 2019-12-07 18:06:40
问题 My installer creates services with the following command in Inno Setup: Filename: {sys}\sc.exe; Check: IsAdminLoggedOn; Parameters: "create Example start= delayed-auto binPath= ""{app}\Example.exe"""; Flags: runhidden This line works in all Windows besides Windows XP because the delayed-auto startup type is not supported in Windows XP. I need to use the delayed-auto startup type for two reasons. My service needs to always run on the background without user intervention, which means that the

resources on creating a windows service using c#

我怕爱的太早我们不能终老 提交于 2019-12-07 17:43:24
does anyone knows any good resources and articles that can explain how to create windows services using c#. thanks I'd suggest you Google for the different parts, different places on the web have different information focus (and level of up-to date info). You need to know about these topics: Windows Service backgrounders: How services work in Windows. See how they are different in regards to user interface, system privileges (which account the service runs under, and what are its privileges), startup/shutdown, and user feedback. One thing you may want to do in a service is use a Timer control

unhandled exceptions in a windows service

青春壹個敷衍的年華 提交于 2019-12-07 17:40:55
问题 I have created a .net c# windows service that runs multiple tasks. I included exception handling in it but I would like to set up a global handler to catch unhandled exceptions in the windows service, how can I do this? 回答1: I included exception handling in it but I would like to set up a global handler to catch unhandled exceptions in the windows service You could use AppDomain.UnhandledException . In your case however, your entire call to your service can be wrapped in a try/catch block.

How do you debug a windows service that is being installed?

半城伤御伤魂 提交于 2019-12-07 16:10:30
问题 I know how to attach a debugger to a windows service, but I can't seem to get attached to one that's being installed and started by a windows installer. I've tried: Setting a Thread.Sleep(TimeSpan.FromSeconds(30)); at the beginning of the on-start, but when I try to attach in Visual Studio, the name of the service does not appear as an option. This normally works, the service's name shows up in the list, but when using the installer it does not. Setting a Debugger.Break and Debugger.Launch.

running UI with windows service

为君一笑 提交于 2019-12-07 15:28:55
问题 i am planning to run a launch/monitor a UI application using a windows service(written in C#).with "Allow service to interact with desktop " checked. this works fine with windows xp, but with windows 7 a pop is shown as below and when i click on view the message , then the whole screen blanks out,with only UI showing up ,as shown below. is there any way to make it work without the message being shown and screen going blank. comments/suggestions appreciated. Regards DEE 回答1: "Allow service to

Windows Authentication for Kestrel hosted in Windows service

穿精又带淫゛_ 提交于 2019-12-07 14:11:58
问题 I am running an ASP.NET Core application hosted in a Windows service as described here: https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/windows-service?view=aspnetcore-2.1 I need this application to support Windows Authentication. What are my options? I tried using Application Request Routing / URL Rewrite module in IIS as a reverse proxy with Windows Authentication but could not figure out how to make that work. Any guidance would be appreciated. 回答1: Microsoft has a whole