windows-services

My exe runs fine by itself, but does nothing when loaded by a service

风格不统一 提交于 2019-12-24 08:37:04
问题 Simple exe for a tray icon, that works fine independently I call it using a windows service, and it seems to run(in task manager) but it dosnt seem to exec any code. ie no tray icon etc. 回答1: On Vista and Windows 2008, services run in a different session than the user -- any EXE that a service runs will run in the same session as the service. Before Vista, you need to check the "Allow Service to interact with desktop" box, otherwise the same thing applies. This means that your tray icon EXE

How to update MYSQL Database with data from Excel using ASP.NET?

非 Y 不嫁゛ 提交于 2019-12-24 08:24:45
问题 I have an excel file which gets updated every 10 seconds through an automated process. I need excel data to be updated in MY-SQL database which is located on a remote server. How do I do that? I have thought of following option: 1) Every 11 seconds, an Excel macro will run and will "Save as" excel as CSV file. (not sure whether this can be done by macro...just thinking) 2) This CSV file we will FTP to remote server using Windows Service. 3) On remote server, we will parse the csv file and

C# Windows Service not running correctly

我与影子孤独终老i 提交于 2019-12-24 06:52:32
问题 I've written a Windows Service (using Visual Studio 2010 Premium, C#, .NET 4) to monitor a folder. All it does is detect when a change is made in the folder (a file/folder added, something deleted, etc) and writes the detections to a text file. Not an Event Log, just a normal .txt file. Now, it installs fine (I presume), and it shows up in Computer Management and allows me to run it. It supposed to write "Monitoring started" to the file - but it doesn't. Then, when I try to stop the service

How can I give SQL Server permission to read my SSL Key?

白昼怎懂夜的黑 提交于 2019-12-24 06:48:16
问题 I recently created a self-signed certificate and turned encryption on in SQL Server 2014: The problem is that now the SQL Server service won't start: This article from 2010 identifies the problem as a permissions issue: The SQL Server service does not have the necessary permission to read the SSL cert's private key. The problem is that I am stuck on step 4 of the solution proposed in the article: There is no group or user name matching the proposed format when I bring up the window shown in

How to refresh logon screensaver parameter changes?

让人想犯罪 __ 提交于 2019-12-24 05:32:22
问题 I have a Windows service that may change the timeout on the logon screensaver in Windows (as described here.) To do that I change the following registry key to the timeout in seconds: HKEY_USERS\.DEFAULT\Control Panel\Desktop\ScreenSaveTimeOut The issue is that how do I make OS "read" or refresh the actual screensaver timeout after a change in the registry key above? My practice shows that it is refreshed (for sure) only when I reboot the system, but in my case I need it to be applied without

How to refresh logon screensaver parameter changes?

…衆ロ難τιáo~ 提交于 2019-12-24 05:31:24
问题 I have a Windows service that may change the timeout on the logon screensaver in Windows (as described here.) To do that I change the following registry key to the timeout in seconds: HKEY_USERS\.DEFAULT\Control Panel\Desktop\ScreenSaveTimeOut The issue is that how do I make OS "read" or refresh the actual screensaver timeout after a change in the registry key above? My practice shows that it is refreshed (for sure) only when I reboot the system, but in my case I need it to be applied without

Create Java Application to run as a Windows Service

做~自己de王妃 提交于 2019-12-24 05:04:37
问题 i want to create a Windows Service which runs my Java-Application. This was no problem by using sc.exe create myService binPath= "java -jar C:\to\my\service.jar" When I try to start my created service i get this response: Error 1053: The service did not respond to the start or control request in a timely fashion Unfortunately it seems my Program didn't respond to the Windows Service that it is running. How can I communicate to the Windows-Service that my Programm runs? I tried NSSM which

How can I get my TCP listener service to terminate correctly?

ε祈祈猫儿з 提交于 2019-12-24 04:50:06
问题 I'm writing a Windows service which starts a TCP listener. The core code works fine, but I'm having several problems with the mechanics of a Windows service. Right now, when my service starts up, it creates a thread and starts the TCP listener in the thread. Then, when the service stops, it terminates that thread: Public Class txnSocketService Inherits System.ServiceProcess.ServiceBase Private listenerThread As Thread Public Sub New() Me.ServiceName = "txnSocketService" Me.CanStop = True Me

How can I find the location of exe that runs as a windows service in run-time?

牧云@^-^@ 提交于 2019-12-24 04:48:44
问题 How can I find the location of exe that runs as a windows service in run-time? 回答1: .NET - Assembly.GetExecutingAssembly().Location (others have suggested Application.ExecutablePath , but this requires a reference to System.Windows.Forms , which a service normally doesn't need) Native - GetModuleFileName(NULL, ...) 回答2: Use a registry look-up: e.g. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\' + ServiceDisplayName; then read ImagePath value. 回答3: Programmatically or with a tool? In

Calling Web Service in a Windows Service

放肆的年华 提交于 2019-12-24 04:47:07
问题 I've used a simple windows service to make a method work in specific time and it works fine. Following that I've already tried: protected override void OnStart(string[] args) { this.WriteToFile("Simple Service started {0}"); this.ScheduleService(); } protected override void OnStop() { this.WriteToFile("Simple Service stopped {0}"); this.Schedular.Dispose(); } private Timer Schedular; public void ScheduleService() { try { Schedular = new Timer(new TimerCallback(SchedularCallback)); string mode