在窗口应用程序中登录表单 [英] Log In Form in window apps
本文介绍了在窗口应用程序中登录表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用C#开发用于登录表单的WIndow应用程序,并且想知道我该怎么做.
任何可通过网络获取的示例.
请帮忙.
Vijay
I am developing WIndow Application with C# for log in form and like to know how can I do that.
ANY Example available over net.
please help.
Vijay
推荐答案
尝试一下
Windows应用程序登录表 [
Try this
Login Form for Windows Application[^]
Also check other answers in that page.
1)将登录表单创建为一个单独的类,从Form派生:将其命名为frmLogin或类似名称.
2)在您的主Form Load事件中创建一个实例.
3)将登录表单显示为模式对话框.
4)检查用户的响应,以确保其用户详细信息正确.
1) Create your log in form as a separate class, derived from Form: call it frmLogin or similar.
2) Create an instance in your main Form Load event.
3) Show the login form as a modal dialog.
4) Check the users responses to ensure his user details are ok.
bool loggedIn = false;
while (!loggedIn)
{
frmLogin f = new frmLogin();
if (frmLogin.ShowDialog == DialogResult.Cancel)
{
Close();
return;
}
if (IsGoodLogin(f.UserName, f.Password))
{
loggedIn = true;
}
}
然后,您要做的就是写IsGoodLogin-我无能为力,因为我对您如何存储名称和密码一无所知.但是,这里有关于密码存储的说明:密码存储:如何进行. [^ ]
Then all you have to do is write IsGoodLogin - I can''t help as I don''t know anything about how you store names and passwords. However there is a note on password storage here: Password Storage: How to do it.[^]
一个简单的Windows窗体登录控件组件 [ ^ ]
这篇关于在窗口应用程序中登录表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文