使用GINA登录方法定制 [英] Login method Customization using GINA

查看:155
本文介绍了使用GINA登录方法定制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这不容易找到在GINA的高手,但我的问题是最为接近进程间通信(IPC),我写了我的自定义GINA在非托管C ++,我把它来检查指纹的有效性的方法用户尝试登录时,该功能将调用在运行系统中的Windows服务C#编写的一些方法,在code如下:

I know it's not easy to find a master in GINA, but my question is most near to Interprocess Communication(IPC), I wrote my custom GINA in unmanaged c++, I included it a method that checks for validity of a fingerprint for the user try to login, this function will call some method in a running system windows service written in c#, the code follows:

在GINA,非托管C ++

in GINA, unmanaged c++

if(Fingerprint.Validate(userName,finerprintTemplate)
{
    //perform login
}

在窗口服务,C#

public class Fingerprint
{
   public static bool Validate(string userName, byte[] finerprintTemplate)
   {
      //Preform Some code to validate fingerprintTemplate with userName
      //and retuen result
   }
}

有谁知道怎么做GINA和窗口服务,或只是C ++编写的服务和C#编写的服务之间的通信等。

Does anyone know how to do such Communication between GINA and the windows service, or simply between c++ written service and C# written service.

感谢

推荐答案

与(潜在地需要跨会话/桌面界面或最IPC)服务通信的典型方法是命名管道。您可以使用邮件槽为好,但你必须处理的重复问题,因为邮筒的邮件得到所有已安装协议欺骗,所以你需要某种标签系统...变得有点凌乱。

The canonical method for communicating with a service (or most IPC that potentially needs to cross a session/desktop boundary) is a named pipe. You can use mailslots as well, but you have to deal with duplication issues because mailslot messages get duped across all installed protocols, so you need some kind of tagging system... gets kinda messy.

请参阅该文档的CreateNamedPipe,并从那里工作,你的出路。我刚才讲的C ++和使用管道C#之间:互操作变得有点凌乱(二进制消息),但它的DO-能力。这里也有一些示例code对C#管道(双方)<一href="http://www.switchonthe$c$c.com/tutorials/interprocess-communication-using-named-pipes-in-csharp"相对=nofollow>这里。

See the docs for CreateNamedPipe and work your way out from there. I have talked between C++ and C# using pipes: the interop got a little messy (binary messages), but its do-able. There's some sample code for C# pipes (from both sides) here.

有关使用管道为您的特定服务,以服务通讯科的问题是,你可以在以后扩展的设计,如果你需要它支持用户界面的好处。

The nice thing about using a pipe for your specific service to service comms problem is you can expand the design later on to support a UI if you need it.

这篇关于使用GINA登录方法定制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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