请给我一个C#windows应用程序中的简单注册表单代码,检查用户是否已经存在... [英] Pls give me a code for Simple Registration form in C# windows application with check user already exists or not...

查看:171
本文介绍了请给我一个C#windows应用程序中的简单注册表单代码,检查用户是否已经存在...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请在C#windows应用程序中给我一个简单注册表单的代码,检查用户是否已经存在...



如果我输入之前的值,它无法进入数据库。请给出一个代码...

解决方案

这不是我们交给你所需代码的地方。我建议你谷歌搜索一些例子,甚至搜索本网站上的文章, http://www.codeproject.com /search.aspx?sbo=kw [ ^ ]。



然后,当你遇到某些具体问题时,请回来问一个具体的问题,我们很乐意帮助你。

也许这段代码会帮助你: -



  if (TextBox1.Text ==   admin&&&textBox2.Text ==   pass
Response.Redirect( admpanel.aspx);
else if (TextBox1.Text == director&& TextBox2.Text == pass
Response.Redirect( admpanel.aspx< /跨度>);
// 否则if(TextBox1.Text == ds.Tables [0] .Rows [0] [ user]。ToString()&& TextBox2.Text == ds.Tables [0] .Rows [0] [pass]。ToString())
// Response.Redirect(admnpanel.aspx);
else
Response.Write( 无效的用户名/密码);
}


Pls give me a code for Simple Registration form in C# windows application with check user already exists or not...

If i enter the previous value, it couldn't not entered to database. please give a code...

解决方案

This is not a place where we hand you all the code you need. I would suggest you google for some examples or even search the Articles on this site, http://www.codeproject.com/search.aspx?sbo=kw[^].

Then, when you get stuck on something specific please come back and ask a specific question and we'll gladly help you out.


Maybe this code will help you out:-

if (TextBox1.Text == "admin" && TextBox2.Text == "pass")
        Response.Redirect("admpanel.aspx");
    else if (TextBox1.Text == "director" && TextBox2.Text == "pass")
        Response.Redirect("admpanel.aspx");
    //else if(TextBox1.Text==ds.Tables[0].Rows[0]["user"].ToString() && TextBox2.Text==ds.Tables[0].Rows[0]["pass"].ToString())
    //    Response.Redirect("admnpanel.aspx");
    else
        Response.Write("Invalid Username/Password");
}


这篇关于请给我一个C#windows应用程序中的简单注册表单代码,检查用户是否已经存在...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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