我可以使用logonuser(...)函数登录Windows 7吗? [英] Can I use logonuser(...) function to logon to windows 7?

查看:331
本文介绍了我可以使用logonuser(...)函数登录Windows 7吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试创建一个简单的Windows服务应用程序,该应用程序输入登录凭据,并单击一个按钮即可登录.我已经阅读了有关GINA和凭据提供程序的信息.我也看过许多文章,包括: http://msdn.microsoft.com/en-us/library/aa379608%28VS.85%29.aspx .

I've been trying to create a simple windows service application that inputs the logon credentials and with a click of a button logs you on. I have read about GINA and Credential Provider. I have also looked at many articles including: http://msdn.microsoft.com/en-us/library/aa379608%28VS.85%29.aspx.

我只想知道是否可以使用Windows提供的logonuser功能进行登录?

I just want to know if it is possible to logon using the logonuser function provided by windows?

推荐答案

不,您不能,使用LogonUser()只是登录过程中许多步骤中的一个步骤.另外,GINA仅在XP中使用,而更早的版本则不能在Windows 7中使用.

No you can not, using LogonUser() is only one step of many in the logon process. Also GINA is only used in XP and earlier you can not use it on Windows 7.

您将需要创建一个自定义的凭据提供程序(这不是一件容易的事),并且用任何.NET语言编写都不容易,它被设计为与本机代码(如C ++或C ),并且几乎没有可用的.NET资源(如果有)作为示例代码.

You will need to instead create a custom Credential Provider (which is not a easy task to do) and it will not be easy to write in any .NET language, it was designed to work with native code (like C++ or C) and there are very few .NET resources available (if any) for example code.

如果您选择使用.NET编写,则必须使用.NET 4.0或更高版本,原因是

If you do choose to write it in .NET you must use .NET 4.0 or newer due to the new features with Side by Side runtimes. If you write it in a older version it may crash your computer if two competing runtimes attempt to load at the same time. Also if you do get it running and working and then uninstall .NET 4.0 from your computer it also may crash your computer.

这篇关于我可以使用logonuser(...)函数登录Windows 7吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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