大家有没关于用户登陆的源代码啊?
那个"登陆"buttom的click事件里应该写些什么C#代码啊?
急求,谢谢谢谢!
那个"登陆"buttom的click事件里应该写些什么C#代码啊?
急求,谢谢谢谢!
解决方案 »
- string 串的问题,帮解决一下啊!
- linq to entity三层架构的疑问
- 在winform中 不同的用户进入不同的界面 用C#语言
- C#绑定Oracle的问题
- C#中如何通过GDI+把矩形窗体四个直角变成圆弧状
- 一个有关static修饰的同步疑问,请高手解答,马上给分
- 又一个API调用写法的问题,大家来帮帮我!!!!
- 【求助】如何得到webBrowser中的表格对象???
- 求助C#高级编程(第3版)的下载,最好是中文版的
- 未能找到VisualStudio.Data.Interop.IVsDataProviderManager服务
- 应聘微创, 获得一个面向开发者的技术支持这样一个先实习再工作机会, 大家说我要不要去? 诸位给点经验...
- 我为什么装不上.net,差哪了,多多指教
public void denglu(object sender,Eventargs e)
{
...
}
{
Response.Write("<script>alert('用戶名或密碼不能空')</script>");
}
int i;
SqlConnection myconnect=new SqlConnection(System.Configuration.ConfigurationSettings.AppSettings["myconnectionstring"]);
//myconnect.ConnectionString="workstation id=HH_LI;packet size=4096;user id=sa; password=javabean ;data source=192.168.42.32;persist security info=False;initial catalog=bookmanage";
SqlCommand mycommand=new SqlCommand();
mycommand.Connection=myconnect; mycommand.CommandText="check_id2";
mycommand.CommandType=CommandType.StoredProcedure;
mycommand.Parameters.Add(new SqlParameter("@UserName",SqlDbType.VarChar,50));
mycommand.Parameters.Add(new SqlParameter("@UserPassword",SqlDbType.VarChar,50));
mycommand.Parameters.Add(new SqlParameter("@reason",SqlDbType.Int,4));
mycommand.Parameters["@reason"].Direction=ParameterDirection.Output;
// mycommand.Parameters["@resaon"].Value=0;
mycommand.Parameters["@UserName"].Value=usertext.Text.Trim();
mycommand.Parameters["@UserPassword"].Value=passwordtext.Text.Trim();
try
{
mycommand.Connection.Open();
mycommand.ExecuteNonQuery();
i=Convert.ToInt32(mycommand.Parameters["@reason"].Value.ToString());
if(i==1)
{
Response.Write("<script>window.open('frame.aspx','title','height=window.screen.availHeight,width=window.screen.availWidth,top=0,left=0,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no')</script>");
}
else
{
//Response.Redirect("login.aspx?a=1");
Label3.Text="密碼或用戶名錯誤";
}
mycommand.Connection.Close();
}
catch(Exception ex)
{
Label3.Text=ex.ToString();
}
}
{
string username,pwd;
//check the username & pwd;
//open another window}
private bool chk(string userId,string Pwd)
{
//到数据库中查找有没有符合 userId,Pwd 的
//如果有返回 true
//没有返回 false
}//电机确定按钮的时候
if(chk())
{
Form fm = new From2();
fm.show();
}
else
{
MessageBox.show("登陆失败");
}