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"
}
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
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)