我想做一個簡單的登錄頁面,而不用註冊只是在SQL數據庫中使用的用戶名和密碼。這是我現在寫的按鈕1:如何製作簡單的登錄頁面?
string connection_string = "Path to database";
SqlConnection connect = new SqlConnection();
connect.ConnectionString = connection_string;
connect.Open();
string sql = "Select * FROM Register where [email protected] and [email protected]";
SqlCommand 1 = new SqlCommand("username",textbox1User.text);
SqlCommand 2 = new SqlCommand("password",textbox2pass.text);
這就是我現在所擁有的。我需要做其餘的登錄頁面,如果值確定,那麼我將被重定向到一個頁面上。但我也需要知道如何保護頁面,使其不被其他用戶訪問,只需輸入文件的URL即可。所以它應該只工作如果我登錄。
不要以純文本形式存儲密碼。 – SLaks 2012-03-01 20:08:01
您應該使用ASP.Net的內置成員資格並形成認證系統。不要重新發明車輪,特別是在安全方面。 – SLaks 2012-03-01 20:08:30
在C#新?或作爲開發人員? – 2012-03-01 20:20:18