在已知的VB源代码中怎么查看程序登陆密码? 5

rivateDeclareFunctionGetUserNameLib"advapi32.dll"Alias"GetUserNameA"(ByVallpbufferAsS... rivate Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpbuffer As String, nSize As Long) As Long

Public OK As Boolean
Private Sub Form_Load()
Dim sBuffer As String
Dim lSize As Long

sBuffer = Space$(255)
lSize = Len(sBuffer)
Call GetUserName(sBuffer, lSize)
If lSize > 0 Then
txtUserName.Text = Left$(sBuffer, lSize)
Else
txtUserName.Text = vbNullString
End If
End Sub

Private Sub cmdCancel_Click()
OK = False
Me.Hide
End Sub

Private Sub cmdOK_Click()
'ToDo: create test for correct password
'check for correct password
If txtPassword.Text = "" Then
OK = True
Me.Hide
Else
MsgBox "Invalid Password, try again!", , "Login"
txtPassword.SetFocus
txtPassword.SelStart = 0
txtPassword.SelLength = Len(txtPassword.Text)
End If
End Sub
展开
 我来答
sss99900
2011-07-19 · TA获得超过310个赞
知道小有建树答主
回答量:400
采纳率:0%
帮助的人:394万
展开全部
这段代码里没有获得密码的代码,主要的代码封装在 advapi32.dll中的GetUserName函数里。你看不到的。
匿名用户
2011-07-19
展开全部
Private Sub cmdOK_Click()
'ToDo: create test for correct password
'check for correct password
MsgBox txtPassword.Text '在判断之前看一下输入了啥呗

If txtPassword.Text = "" Then
OK = True
Me.Hide
Else
MsgBox "Invalid Password, try again!", , "Login"
txtPassword.SetFocus
txtPassword.SelStart = 0
txtPassword.SelLength = Len(txtPassword.Text)
End If
End Sub
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式