验证Windows密码

zhoubo99099

zhoubo99099

2016-02-19 14:55

每个人都希望每天都是开心的,不要因为一些琐事扰乱了心情还,闲暇的时间怎么打发,关注图老师可以让你学习更多的好东西,下面为大家推荐验证Windows密码,赶紧看过来吧!

  |声明模块:

(本文来源于图老师网站,更多请访问http://m.tulaoshi.com/bianchengyuyan/)

  

Option Explicit Declare Function GetUserName Lib "advapi32.dll" Alias _ "GetUserNameA" (ByVal lpBuffer As String, _ nSize As Long) As Long Private Declare Function WNetVerifyPassword Lib "mpr.dll" Alias _ "WNetVerifyPasswordA" (ByVal lpszPassword As String, _ ByRef pfMatch As Long) As Long Public Function GetWindowsLoginUserID() As String Dim rtn As Long Dim sBuffer As String Dim lSize As Long sBuffer = String$(260, Chr$(0)) lSize = Len(sBuffer) rtn = GetUserName(sBuffer, lSize) If rtn Then sBuffer = left$(sBuffer, lSize) Reformat string If InStr(sBuffer, Chr$(0)) Then sBuffer = left$(sBuffer, InStr(sBuffer, Chr$(0)) - 1) End If GetWindowsLoginUserID = sBuffer Else Error! GetWindowsLoginUserID = "" End If End Function Public Function VerifyWindowsLoginU Password(ByVal Password As String) As Boolean Dim rtn As Long, Match As Long rtn = WNetVerifyPassword(Password, Match) If rtn Then VerifyWindowsLoginUserPassword = False Else VerifyWindowsLoginUserPassword = (Match $#@60;$#@62; 0) End If End Function

(本文来源于图老师网站,更多请访问http://m.tulaoshi.com/bianchengyuyan/)

  |窗体代码:

  

Private Sub cmdVerify_Click() MsgBox "The password you supplied was " VerifyWindowsLoginUserPassword(txtPassword.Text) End Sub Private Sub Form_Load() txtUsername = GetWindowsLoginUserID txtUsername.Enabled = False End Sub

展开更多 50%)
分享

猜你喜欢

验证Windows密码

编程语言 网络编程
验证Windows密码

QQ本地密码验证破解

编程语言 网络编程
QQ本地密码验证破解

s8lol主宰符文怎么配

英雄联盟 网络游戏
s8lol主宰符文怎么配

Sql语句密码验证安全漏洞

编程语言 网络编程
Sql语句密码验证安全漏洞

ASP程序密码验证问题 (MS,缺陷)

ASP
ASP程序密码验证问题 (MS,缺陷)

lol偷钱流符文搭配推荐

英雄联盟 网络游戏
lol偷钱流符文搭配推荐

基于jQuery的密码强度验证代码

Web开发
基于jQuery的密码强度验证代码

来自Google的密码强度Javascript验证代码

Web开发
来自Google的密码强度Javascript验证代码

lolAD刺客新符文搭配推荐

英雄联盟
lolAD刺客新符文搭配推荐

创建setup类型的进度条

创建setup类型的进度条

5400转的笔记本硬盘和7200转的硬盘差距

5400转的笔记本硬盘和7200转的硬盘差距
下拉加载更多内容 ↓