需要一些仿真资料,觉得觉得SIMWE仿真论坛很不错,那位大哥给发一个邀请码啊!521pott@sina.com,万分感谢
3个回答
展开全部
LoginForm,
---
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.OleDb;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace Login{
public partial class LoginForm : Form
{
OleDbConnection myCnn;
OleDbDataAdapter da;
DataSet ds;
DataTable dt;
public LoginForm()
{
InitializeComponent();
}
private void LoginForm_Load(object sender,rolex watches, EventArgs e)
{
string strConn = System.Configuration.ConfigurationManager.AppSettings["OleDbConnectionstring"].ToString();
myCnn = new OleDbConnection(strConn);
string sql = "SELECT [user].username,UGG Roseberry 5734,[user].password FROM [user]";
da = new OleDbDataAdapter(sql,UGG Gissella 5593, myCnn);
ds = new DataSet("tmpTable");
da.Fill(ds, "tmpTable");
dt = new DataTable();
dt = ds.Tables["tmpTable"];
for (int i = 0; i < dt.Rows.Count; i++)
{
this.comboBox1.Items.Add(dt.Rows["username"]);
this.comboBox1.SelectedIndex = 0;
}
}
private void login_Click(object sender,Men's Classic Mini 5854, EventArgs e)
{
string st;
st = comboBox1.Text.ToString();
string strPwd = "";
strPwd = textBox1.Text.ToString();
for (int i = 0; i < dt.Rows.Count; i++)
{
if (st.Trim() == dt.Rows["username"].ToString().Trim())
{
if (strPwd.Trim() == dt.Rows["password"].ToString().Trim())
{
this.Close();
this.DialogResult = DialogResult.OK;//胜利
}
else
{
MessageBox.Show("你的用户名或密码不准确,请从新输入!");
return;
}
}
}
}
}
}
---
Program.cs
---
using System;
using System.Collections.Generic;
using System.Windows.Forms;
namespace Login
{
static class Program
{
/// <summary>
/// 利用程序的主进口点。
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
// Application.Run(new LoginForm());
LoginForm logfrm = new LoginForm();
if (logfrm.ShowDialog() == DialogResult.OK)
{
Application.Run(new MainForm());
}
}
}
}
---
---
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.OleDb;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace Login{
public partial class LoginForm : Form
{
OleDbConnection myCnn;
OleDbDataAdapter da;
DataSet ds;
DataTable dt;
public LoginForm()
{
InitializeComponent();
}
private void LoginForm_Load(object sender,rolex watches, EventArgs e)
{
string strConn = System.Configuration.ConfigurationManager.AppSettings["OleDbConnectionstring"].ToString();
myCnn = new OleDbConnection(strConn);
string sql = "SELECT [user].username,UGG Roseberry 5734,[user].password FROM [user]";
da = new OleDbDataAdapter(sql,UGG Gissella 5593, myCnn);
ds = new DataSet("tmpTable");
da.Fill(ds, "tmpTable");
dt = new DataTable();
dt = ds.Tables["tmpTable"];
for (int i = 0; i < dt.Rows.Count; i++)
{
this.comboBox1.Items.Add(dt.Rows["username"]);
this.comboBox1.SelectedIndex = 0;
}
}
private void login_Click(object sender,Men's Classic Mini 5854, EventArgs e)
{
string st;
st = comboBox1.Text.ToString();
string strPwd = "";
strPwd = textBox1.Text.ToString();
for (int i = 0; i < dt.Rows.Count; i++)
{
if (st.Trim() == dt.Rows["username"].ToString().Trim())
{
if (strPwd.Trim() == dt.Rows["password"].ToString().Trim())
{
this.Close();
this.DialogResult = DialogResult.OK;//胜利
}
else
{
MessageBox.Show("你的用户名或密码不准确,请从新输入!");
return;
}
}
}
}
}
}
---
Program.cs
---
using System;
using System.Collections.Generic;
using System.Windows.Forms;
namespace Login
{
static class Program
{
/// <summary>
/// 利用程序的主进口点。
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
// Application.Run(new LoginForm());
LoginForm logfrm = new LoginForm();
if (logfrm.ShowDialog() == DialogResult.OK)
{
Application.Run(new MainForm());
}
}
}
}
---
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2012-03-25
展开全部
你好你要的资源已经发你了满意的话请有效率的采纳我的答案吧如果想表达你的谢意~~~那就加分吧(*^__^*)……~ 收件箱内没有. 请看下垃圾箱如果没收到,请百度尽快HI我或者给我发邮件,我会尽快解决的。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
发一个邀请码需要20个论坛币,最好找你认识的朋友。一般不会随便给你的。
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询