| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1278 人关注过本帖, 1 人收藏
标题:密码登陆窗体
只看楼主 加入收藏
donghaojie
Rank: 1
来 自:河南
等 级:新手上路
威 望:1
帖 子:55
专家分:0
注 册:2008-9-11
收藏(1)
 问题点数:0 回复次数:5 
密码登陆窗体
密码登陆窗体1代码
Private Sub Command1_Click()
Static times As Integer
If Trim(Text1.Text) = "123456" Then
Label2.Caption = "欢迎进入本软件!"
Label2.ForeColor = vbBlue
Label2.FontSize = 20
Label2.FontName = "华文行楷"
Else
If times < 2 Then
Label2.Caption = "密码错误,你还有" + Trim(Str(2 - times)) + "次机会,请重新输入!"

Label2.ForeColor = vbRed
Label2.FontSize = 13
Label2.FontName = "华文行楷"
Text1.Text = ""
Text1.SetFocus
times = times + 1
Else
Label2.Caption = "非法用户,请退出!"

Label2.ForeColor = vbRed
Label2.FontSize = 20
Label2.FontName = "华文行楷"
Text1.Text = ""
Text1.Locked = True
End If
End If
If (Text1.Text = "123456") Then
Form1.Hide
Form2.Show
End If





End Sub

Private Sub Command2_Click()
End

End Sub



Private Sub Command3_Click()
Label2.Caption = "请在上面输入密码!"

Label2.ForeColor = vbBlue
Label2.FontSize = 20
Label2.FontName = "华文行楷"
Text1.Text = ""

End Sub

Private Sub Form_Load()
Text1.MaxLength = 6
Text1.PasswordChar = "*"
Label2.AutoSize = True
Text1.Text = ""


End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
Select Case KeyAscii
Case 48 To 57, 8
Case Else
KeyAscii = 0
End Select

End Sub
密码登陆窗体2代码
Private Declare Function GetDiskFreeSpace Lib "kernel32" Alias "GetDiskFreeSpaceA" (ByVal lpRootPathName As String, lpSectorsPerCluster As Long, lpBytesPerSector As Long, lpNumberOfFreeClusters As Long, lpTtoalNumberOfClusters As Long) As Long

Private Sub Command1_Click()
Dim a, b, c, d, free, total As Long
Dim disk As String
disk = Text1.Text
GetDiskFreeSpace disk, a, b, c, d
total = d * b * a / 1024 / 1024
free = c * a * b / 1024 / 1024
Label3.Caption = total & "MB"
Label4.Caption = free & "MB"
End Sub


Private Sub Command2_Click()
Text1.Text = ""
Label4.Caption = ""
Label3.Caption = ""

End Sub

Private Sub Command3_Click()
End
End Sub


Private Sub Timer1_Timer()
Label6.Left = Label6.Left + 50
If Label6.Left >= Form1.Width Then
Label6.Left = -Label6.Width
End If

End Sub




密码为:123456

工程1.rar (6.24 KB)
收到的鲜花
  • 永夜的极光2008-11-07 11:41 送鲜花  49朵   附言:好文章
搜索更多相关主题的帖子: 窗体 密码 登陆 
2008-11-06 16:06
pheonix99
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2007-12-2
收藏
得分:0 
ding
2008-11-07 10:07
sputnik
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2006-2-18
收藏
得分:0 
厚道!
2008-11-14 20:37
renaoren
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2008-11-15
收藏
得分:0 
不过,你没把工具到放进去#
2008-11-15 02:45
skdyu
Rank: 1
等 级:新手上路
帖 子:38
专家分:0
注 册:2007-3-26
收藏
得分:0 
谢谢学习参考!!!!!!!!!!
2008-11-15 14:45
g602772968
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2011-7-31
收藏
得分:0 
回复 楼主 donghaojie
学习,谢谢楼主分享
2011-07-31 20:34
快速回复:密码登陆窗体
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.018452 second(s), 11 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved