windows-services

Creating a Windows service with user notification in C#?

心已入冬 提交于 2019-12-13 03:47:27
问题 I want to create Windows service in such a way : -> It takes input database information ... -> at completion of service it notifies user for completion of process. How can I do this with Windows service in C#.Net? Thanks 回答1: I think you are asking three questions: How do I create a Windows Service How do I open and read data from a database How do I notify a user Answers: Example If you can use .NET 3.5 and SQL Server 2005 or 2008, I would recommend LINQ to SQL A Windows Service has no UI,

Scheduling in Asp.net.What is best solution?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-13 03:38:23
问题 I want to Scheduling in Asp.net I have following options to implement this To write SQLServer JOB(I dont want to do this.Dont want to go outside of .Net environment) Second option is I will write windows service and this window service will call asp.net webservice then this webservice calls asp.net method (I also dont need to do this because my hosting provider might not be allow me to install window service) Third option is I call my scheduling method in Application_Start event in global

windows services to perform schedule email in php [duplicate]

醉酒当歌 提交于 2019-12-13 02:45:58
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: schedule an email in php I want to schedule my php script which sends emails using windows services as the website is hosted in windows machine. I am looking for a solution which does not involve cron jobs. I want users to schedule a time and the windows service should execute my php email script on the scheduled time so that emails are sent on the scheduled user time. I want to write the entire code in php. 回答1

How come my Windows Service cannot access a folder with files in them?

偶尔善良 提交于 2019-12-13 02:45:01
问题 I have setup a Console, Library, and Service project. The Library project loads up files in a folder and stores the text in variables. The console project will then manipulate those variables. I am able to run the Console project successfully and it loads the files without a problem. The files are set to Copy Always in the DLL and are specified as Content for the Build Action. When I try to run the exact same code in the service. File.ReadAllText(@"MyFolder\SomeFile.txt"); It throws the

C# Access registry of another user

*爱你&永不变心* 提交于 2019-12-13 02:35:18
问题 I'm having a problem with the windows service I work on currently. Basically I store some values in HKCU registry (from a GUI tool run as administrator) and from within that GUI I am starting a service. The service uses SYSTEM account to run and I believe that's my problem - I can't access registry keys stored with my GUI tool inside the service, as it points to a different HKCU! How can I "redirect" the service to use the HKCU of the user it was stored with? (Actually I can pass a user name

C# - SendInput() from Windows Service not working but returns 1 - Win03

ぃ、小莉子 提交于 2019-12-13 02:34:33
问题 This is a somewhat unusual problem. I'm presently working on an effort to automate an Office application. Basically the issue is that my app is able to interact with the Office app correctly when I execute my app via RDP, but I am unable to send keystrokes using SendInput() if I set up the application to spawn from a windows service. OS is Win03 Std. When spawning the app from a windows service I'm able to read window captions, automate through the interop, etc. as expected via pinvoke, but

How to force a service's bitness

江枫思渺然 提交于 2019-12-13 02:16:51
问题 I have several C# Windows service. One insists on running as a 64 bit process. This wouldn't be a problem except that I migrated all shared configuration, to C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config As a result the service fails to read the config, and for the moment I am having to duplicate the shared configuration (which defeats the point of moving it to machine.config) I have changed the build configuration from x64 to x86, and re-installed but the service still runs in 64 bit

Sql Dependency onchange event not firing every time c#

我怕爱的太早我们不能终老 提交于 2019-12-13 01:36:42
问题 I have implemented sql dependency in windows service. when data will be changed in table then onchange event will fire and from there I am invoking a web service. I will share my full code. I tested many time on my PC before installing the windows service on production PC it works. Suppose if I install on production PC today then it works for today but when I test next day then its onchange event was not firing. so I found onchange event firing only first day and from the next day onchange

When do windows xp services get started?

蓝咒 提交于 2019-12-13 01:25:18
问题 When a machine reboots, do all the services which are run under the accounts (system/service/network service) get run before a user logs on? JD. 回答1: Services have a "start type" defined per-service, those types are boot, system, auto, demand, disabled. Services also have dependencies on each other, defined in the registry. Services with boot and system start type are started during the time period when only NT Native binaries can run (the Win32 API is not yet ready). For example, these

Using PsExec in a Windows Service

前提是你 提交于 2019-12-13 00:49:14
问题 I have created a Windows Service using C# which performs variance network maintenance tasks for me. One of the tasks is defraging machines remotely and for some of my older boxes I found the only way to do this was using psexec with defrag.exe. The code works fine when I simply run my C# code, however when I covert it into a Windows Service it does the defraging using the Win32_Volume table fine but it seems to get hung up when attempting to use PsExec to defrag the XP machines. I guess my