windows-services

How to communicate with a windows service from an application that interacts with the desktop?

别说谁变了你拦得住时间么 提交于 2019-11-27 04:38:21
With .Net what is the best way to interact with a service (i.e. how do most tray-apps communicate with their servers). It would be preferred if this method would be cross-platform as well (working in Mono, so I guess remoting is out?) Edit: Forgot to mention, we still have to support Windows 2000 machines in the field, so WCF and anything above .Net 2.0 won't fly. Be aware that if you are planning to eventually deploy on Windows Vista or Windows Server 2008, many ways that this can be done today will not work. This is because of the introduction of a new security feature called "Session 0

WCF Windows Service - Long operations/Callback to calling module

人盡茶涼 提交于 2019-11-27 04:28:59
问题 I have a Windows Service that takes the name of a bunch of files and do operations on them (zip/unzip, updating db etc). The operations can take time depending on size and number of files sent to the service. (1) The module that is sending a request to this service waits until the files are processed. I want to know if there is a way to provide a callback in the service that will notify the calling module when it is finished processing the files. Please note that multiple modules can call the

Windows 2008 RenderFarm Service: CreateProcessAsUser “Session 0 Isolation” and OpenGL

落花浮王杯 提交于 2019-11-27 04:26:03
问题 I have a legacy Windows server service and (spawned) application that works fine in XP-64 and W2K3, but fails on W2K8. I believe it is because of the new "Session 0 isolation" feature. Consequently, I'm looking for code samples/security settings mojo that let you create a new process from a windows service for Windows 2008 Server such that I can restore (and possibly surpass) the previous behavior. I need a solution that: Creates the new process in a non-zero session to get around session-0

Check status of services that run in a remote computer using C#

末鹿安然 提交于 2019-11-27 04:21:35
问题 I'm using the following code. ServiceController MyController = new ServiceController(); MyController.MachineName = server_txt.Text.Trim(); MyController.ServiceName = "Service1"; string msg = MyController.Status.ToString(); Label1.Text = msg; This code works fine for network computers where I have access. How to change this so it works for the systems in different domains using credentials? 回答1: If you use WMI, you can set the credentials in 'ConnectionOptions'. ConnectionOptions op = new

Print html document from Windows Service without print dialog

让人想犯罪 __ 提交于 2019-11-27 04:16:18
I am using a windows service and i want to print a .html page when the service will start. I am using this code and it's printing well. But a print dialog box come, how do i print without the print dialog box? public void printdoc(string document) { Process printjob = new Process(); printjob.StartInfo.FileName = document; printjob.StartInfo.UseShellExecute = true; printjob.StartInfo.Verb = "print"; printjob.StartInfo.CreateNoWindow = true; printjob.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; printjob.Start(); } Have there any other way to print this without showing the print dialog box.

Logoff interactive users in Windows from a service

戏子无情 提交于 2019-11-27 04:07:29
I'm trying to figure out a way to log off users in local Windows sessions from a Windows Service written in C#. Here's the background to the problem: I need to manage the computer usage time of a set of users; when their allotted time expires I want to log them off. This is in the context of a W2K8 domain. Unfortunately the login time controls in Windows simply disconnect the user from server resources; there is no way to force their sessions to terminate via this method. My approach is to build a Windows Service that I will deploy across the domain; the service will run on every client

create dependency between windows services startup

怎甘沉沦 提交于 2019-11-27 03:46:43
问题 I have created a windows service which is set to start automatically. This service connects to the database service on startup. The issue is the database service seems to start after my service. Is there is a programmatic way to define this dependency so that my service starts after the database service has started. I found this article http://www.boyce.us/windows/servertipcontent.asp?ID=7 which talks about adding a registry entry to do that. I would like to know if there is a C# way to do

The designer could not be shown for this file because none of the classes within it can be designed

孤者浪人 提交于 2019-11-27 03:43:49
问题 We have the following shared component: public class OurServiceBase : System.ServiceProcess.ServiceBase This class has functionality we want in all our downstream services, such as standardized execution scheduling and logging functionality. In a new project, I add the following: public class MyService : System.ServiceProcess.ServiceBase In the Windows Designer, the class shows properly. When I change the service to derive from OurServiceBase public class MyService : OurSharedLibrary

HTTP 407 proxy authentication error when calling a web service

别来无恙 提交于 2019-11-27 03:24:56
问题 I'm working on a .NET app that calls 3rd party web services over the internet. The services do not use SOAP, so we manually construct an XML request document, send it to the service via HTTP, and retrieve an XML response. Our code is a Windows service that is run in the context of a normal Windows domain account, and sits behind a proxy server (Microsoft ISA Server) configured to require NTLM authentication. The account running our service has permission to access the internet through the

Visual Studio 2005 -> 2008/10 Service Installer Project Upgrade issue

雨燕双飞 提交于 2019-11-27 03:16:48
问题 I've upgraded a [.vdproj MSI generator project built into VS2008] System.Configuration.Install.Installer with a ServiceProcessInstaller and a ServiceInstaller from Visual Studio 2005 to 2008. There are no customisations of consequence to the installer class (i.e., not trying to start or stop services or register children) RemovePreviousVersions is set to true , and I'm changing the Version and ProductCode . This triggers an error during the install: "error 1001: the specified service already