fx5u用户认证密码忘了怎么办

fx5u用户认证密码忘了怎么办,第1张

1、首先用SD卡插在PLC上面,做一个无远程口令的空程序

2、其次时做SD卡下载引导程序,下载到SD卡里面。

3、最后断电重启,默认会用新建的SD卡程序覆盖原来PLC内部的程序即可。

#include <iostream>

#include <string>

using namespace std

const int number=3

const string id[number]={"a","b","c"}

const string passwd[number]={"111","222","333"}

int main()

{

    string m,n

    int i

    cin >>m

    for(i=0 i < number i ++)

        if(id[i] == m) break

    if(i == number) 

    {

        cout<< "用户不存在\n"

    }

    else

    {

        cin >>n

        if(passwd[i] == n)

            cout<<"欢迎!\n"

        else cout<<"密码错误\n"

    }

    return 0

}

以上为基础功能. 

扩展如下:

#include <iostream>

#include <string>

using namespace std

const int number=3

const string id[number]={"a","b","c"}

const string passwd[number]={"111","222","333"}

int main()

{

    string m,n

    int i,times

    for(times=0 times<3times++)

    {

        cin >>m

        for(i=0 i < number i ++)

            if(id[i] == m) break

        if(i == number) 

        {

            cout<< "请重新输入.\n"

        }

        else break

    }

    if(times == 3) 

        cout << "用户不存在\n"

    else

    {

        for(times=0 times<3times++)

        {

            cin >>n

            if(passwd[i] == n)

            {

                cout<<"欢迎!\n"

                break

            }

            else cout<<"请重新输入.\n"

        }

        if(times==3) cout<<"密码错误\n"

    }

    

    return 0

}

Private Sub Command1_Click()

If IsNumeric(Text1.Text) And Len(Text1.Text) = 6 And Text2.Text = "good" Then

 MsgBox "输入正确,验证通过", vbOKCancel, "验证通过"

Else

 If MsgBox("账号或密码错误", vbRetryCancel, "验证错误") = vbRetry Then

    Text1.Text = ""

    Text2.Text = ""

    Text1.SetFocus

 Else

    End

 End If

End If

End Sub

Private Sub Form_Load()

Text1.PasswordChar = "*"

End Sub


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/yw/12087595.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-20
下一篇 2023-05-20

发表评论

登录后才能评论

评论列表(0条)

保存