永发信息网

求编写一个vb小程序

答案:1  悬赏:60  手机版
解决时间 2021-11-13 01:40
  • 提问者网友:你给我的爱
  • 2021-11-12 13:01
求编写一个vb小程序
最佳答案
  • 五星知识达人网友:风格不统一
  • 2021-11-12 14:09
添加一1个label,一个command,一个text即可,可循环修改密码

Dim a As String
Private Sub Command1_Click()
If Command1.Caption = "确认" Then
    If Text1 = a Then
        Call nex
    Else
        MsgBox "密码错误!", vbExclamation, "信息"
        Text1 = ""
        Text1.SetFocus
    End If
ElseIf Command1.Caption = "修改" Then
    Call xg
End If
End Sub
Sub nex()
Label1.Caption = "新密码:"
Text1.Text = ""
Text1.SetFocus
Command1.Caption = "修改"
End Sub
Private Sub Form_Load()
Me.Caption = "密码修改"
Text1 = ""
Text1.PasswordChar = "*"
Text1.ToolTipText = "默认密码:admin"
Label1.Caption = "原密码:"
Command1.Caption = "确认"
Call mi
End Sub
Sub mi()
If Dir(App.Path + "mm") <> "" Then
    Open App.Path + "mm" For Input As #1
        Input #1, a
    Close #1
End If
    If a = "" Then a = "admin"
End Sub
Sub xg()
Open App.Path + "mm" For Output As #1
    Print #1, Text1.Text
Close #1
a = Text1
MsgBox "密码修改成功!", vbInformation, "提示"
Text1 = ""
Text1.SetFocus
Command1.Caption = "确认"
Label1.Caption = "原密码:"

End Sub追问麻烦了 如果是这样的界面呢 三个textbox的

我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯