我正在尝试编写一个简单的 C# 程序来使用 Microsoft 的 dll“passfilt.dll”捕获密码更改事件。我读到了它提供的功能。我刚刚使用了“InitializeChangeNotify”及其返回true。现在我将如何使用“PasswordChangeNotify”方法并以明文形式获取密码? 这是我的代码!
using System.Text;
using System.Runtime.InteropServices;
class Program
{
[DllImport("passfilt.dll" ,EntryPoint="#1" )]
public extern static Boolean InitializeChangeNotify();
static void Main(string[] args)
{
Boolean ans= InitializeChangeNotify();
Console.WriteLine("Answer " + ans);
Console.ReadKey();
}
}
注意:我是 C# 新手。我找不到任何相关的示例程序。帮帮我吧!
最佳答案
您无法使用passfilt.dll
捕获密码更改事件。该 dll 是 Windows 用于检查密码质量的过滤器。
过滤器包含三个按顺序调用的函数(InitializeChangeNotify
、PasswordFilter
和 PasswordChangeNotify
)。第一个用于初始化过滤器,第二个用于检查密码的质量,最后一个用于通知 dll Windows 已更改密码。所有函数均由 Windows 调用。
您也可以调用这些函数,但不能使用 PasswordChangeNotify
捕获密码更改事件。
如果您想捕获密码更改事件,您将拥有 to write a filter您自己并将其安装到您的计算机上。然后 Windows 将调用 PasswordChangeNotify
让您知道密码已更改。
关于c# - 尝试编写一个简单的C#程序来使用密码过滤功能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20897831/