多个用户名和密码? [英] Multiple username and passwords?

查看:115
本文介绍了多个用户名和密码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法用这个做多个用户名和密码?



Is there a way to do multiple username and passwords with this?

if ((textBox1.Text == "Quinn") && (textBox2.Text == "Qmanqtip12"))
{ 
  System.Threading.Thread.Sleep(4000); 
  MessageBox.Show("Welcome To AL7", "Login Succesfull", 
  MessageBoxButtons.OK, MessageBoxIcon.Information); 
  new Form2().Show(); 
  this.Hide(); 
} 
else 
{ 
  MessageBox.Show("Usename or Password Incorrect", "Error", 
  MessageBoxButtons.OK, MessageBoxIcon.Exclamation); 
} 





我的尝试:



做,和其他没有工作



What I have tried:

Doing , and other "" and no work

推荐答案

Quote:

有没有办法用这个做多个用户名和密码?

Is there a way to do multiple username and passwords with this?

即使你不是开发人员,我认为代码仍然很容易阅读,这段代码只适用于一个用户名和密码组合。



评论为您提供了如何解决问题的建议,但由于您没有回复,我将其作为解决方案发布,因为它确实回答了您的问题。

Even if you are not a developer, I think the code is still easy enough to read that this code only works with one username and password combination.

The comments have given you suggestions on how to fix it but since you have not replied I am posting this as solution since it does answer your question.


在一个循环中使用一个(允许的) UserInfo 对象的数组,每个对象都有一个用户名和一个密码字段。
Use, in a loop, an array of (allowed) UserInfo objects, each of them having a username and a password fields.






尝试使用某个数据库来存储您的用户,并让他们只能使用您的应用程序。你是拥有所有权利的管理员。



然后为所有用户创建一个通用登录系统。所有只使用你的系统为其他人系统弹出消息。
Hi,

Try some database to store your users, nd let them only aalow to use your aplication. U be the admin who hav all rights .

And then create a generalize login system for all users. All to use your system only to auhtneticated ones for others popup the message .


这篇关于多个用户名和密码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆