Windows用户登录/注销触发WCF服务方法 [英] Windows user logon/logoff triggering a wcf service method

查看:78
本文介绍了Windows用户登录/注销触发WCF服务方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在Google,codeplex,codeproject,stackoverflow,dream.in.code上搜索...似乎什么都没有出现.

我对该项目的最终结果是拥有在计算机实验室中运行的服务.用户登录后,运行的服务将向服务器发送用户信息,计算机名称和已登录"布尔值.服务器仅保留该计算机名称的已登录"状态,而是使用用户信息查看服务器是否具有该用户类别的任何消息.然后,当用户注销时,该服务会将计算机名称和注销"布尔发送给服务器.

我没有使用WCF或Windows事件编码的丰富经验,因此当涉及通过用户登录/注销来触发该服务的一部分时,我迷失了.

如果我使用Windows窗体并通过单击按钮触发数据收集,就可以获得我需要的所有信息,但是当将其用作wcf时这无济于事.

那么,对于用户如何在用户登录或注销时如何运行该方法,是否有人有任何建议?提前致谢!在大海捞针中的这种寻找使我不寒而栗:-)

I''ve been searching on google, codeplex, codeproject, stackoverflow, dream.in.code... nothing seems to be coming up.

My final result for this project is to have a service that is running in a computer lab. As soon as a user logs on, the service running will send the user information, the computer name and a ''logged in'' bool to a server. The server is only keeping the ''logged in'' status for that computer name, but using the user information to see if it has any messages for that category of user. Then, when the user logs off, the service sends the computer name and a ''logged off'' bool to the server.

I don''t have a lot of experience with WCF or coding for Windows events, so I''m lost when it comes to getting a part of the service to trigger with a user logon/logoff.

I can get all the information that I need if I use a windows form and trigger the data collection with a button click, but that doesn''t help when using it as a wcf.

So, does anyone have any advice as to how to get the method to run when the user logs in or logs out? Thanks in advance! This hunt for a needle in a haystack is making my head spin :-)

推荐答案

编写驻留在服务器上的Windows服务.它所做的只是监听客户端连接.收到一个数据后,它会发回该用户的所有未决数据.

编写驻留在给定客户端计算机上的SECOND Windows服务.此服务将通知服务器用户已登录,并将接收服务器发回的数据(如果有),并将其存储在本地数据文件中.

编写一个与本地客户端服务对话的系统任务栏应用程序,并显示从服务器收到的通知.

继续并进行编码.
Write a Windows service that lives on the server. All it does is listen for client connections. When it receives one, it sends back any data for that user that is pending.

Write a SECOND windows service that lives on a given client''s machine. This service will notify the server that the user logged in, and will receive the data that the server sends back (if any), and stores it in a local data file.

Write a system tray application that talks to the local client service and displays notifications received from the server.

Go forth, and code.


这篇关于Windows用户登录/注销触发WCF服务方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆