小编Flo*_*lam的帖子

10
推荐指数
1
解决办法
257
查看次数

如何制作一个简单的登录页面?

我想创建一个简单的登录页面,而不是只注册我在SQL数据库中使用的用户名和密码.这就是我现在为button1写的内容:

string connection_string = "Path to database";
SqlConnection connect = new SqlConnection();
connect.ConnectionString = connection_string;
connect.Open();
string sql = "Select * FROM Register where username=@username and password=@password";
SqlCommand 1 = new SqlCommand("username",textbox1User.text);
SqlCommand 2 = new SqlCommand("password",textbox2pass.text);
Run Code Online (Sandbox Code Playgroud)

这就是我现在拥有的.我需要做其余的登录页面,如果值正常,那么我将被重定向到页面上.但我还需要知道如何通过键入url to file来保护页面不被其他用户访问.所以它应该只在我登录时才有用.

c# sql asp.net

-1
推荐指数
1
解决办法
4968
查看次数

标签 统计

asp.net ×2

c# ×2

gridview ×1

sql ×1

sql-server-2008 ×1