登录方式使用GINA定制

发布于 2024-07-13 11:52:28 字数 772 浏览 4 评论 0原文

重复使用 GINA 自定义登录方法


大家好,

我知道在 GINA 中找到大师并不容易,但我的问题最接近进程间通信(IPC),我用非托管 c++ 编写了我的自定义 GINA,我在其中包含了一个方法来检查用户尝试指纹的有效性登录,此函数将调用用 c# 编写的正在运行的系统 windows 服务中的某些方法,代码如下:

在 GINA 中,

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

windows 服务中的非托管 c++,C#

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

有谁知道如何在 GINA 和 windows 服务之间或简单地之间进行这样的通信C++ 编写的服务和 C# 编写的服务。

谢谢

DUPLICATE:Login method Customization using GINA


Hi All,

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:

in GINA, unmanaged c++

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

in windows service, C#

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

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

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

双马尾 2024-07-20 11:52:34

与服务(或大多数可能需要跨越会话/桌面边界的 IPC)通信的规范方法是命名管道。 您也可以使用邮槽,但您必须处理重复问题,因为邮槽消息在所有已安装的协议中都会被欺骗,因此您需要某种标记系统......变得有点混乱。

请参阅 CreateNamedPipe 的文档并从那里开始工作。 我已经使用管道在 C++ 和 C# 之间进行了讨论:互操作有点混乱(二进制消息),但它是可行的。 有一些 C# 管道的示例代码(来自双方) 在这里

使用管道解决特定服务到服务通信问题的好处是,如果需要,您可以稍后扩展设计以支持 UI。

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.

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文