1.主介面**:
2.註冊頁面
3.登陸介面
登陸註冊**:
//view code編寫登入介面邏輯
using
system;
using
system.collections.generic;
using
system.componentmodel;
using
system.data;
using
system.drawing;
using
system.linq;
using
system.text;
using
system.threading.tasks;
using
system.windows.forms;
using
system.data.sqlclient;
namespace
logindatabase
private
void loginbtn_click(object
sender, eventargs e)
else
} else
if (errortime < 3
) else
}private
void cancelbtn_click(object
sender, eventargs e)
private
void button1_click(object
sender, eventargs e)
private
void checkcode_click(object
sender, eventargs e)
}}5.編寫註冊介面邏輯
using
system;
using
system.collections.generic;
using
system.componentmodel;
using
system.data;
using
system.data.sqlclient;
using
system.drawing;
using
system.linq;
using
system.text;
using
system.threading;
using
system.threading.tasks;
using
system.windows.forms;
namespace
logindatabase
private
void btnregister_click(object
sender, eventargs e)
//確認密碼
if (ensurepw.text !=userpw.text)
//驗證碼
if (textcheck.text !=checkcode.text)
//插入資料sql 邏輯
string s1 = "
insert into register(account,password,nickname) values ('
" + userid.text + "
','" + userpw.text + "
','"
+ nickname.text + "
')"; //
編寫sql命令
sqlcommand mycom = new sqlcommand(s1, mycon); //
初始化命令
mycom.executenonquery(); //
執行語句
mycon.close(); //
關閉連線
mycom = null
; mycon.dispose();
//釋放物件
if (userid.text == "" || userpw.textlength <= 6 || nickname.text == "" || ensurepw.text == ""
|| textcheck.text == ""
) else
}private
void checkcode_click(object
sender, eventargs e)
}
ubuntu root 使用者登陸登陸辦法
習慣於圖形化操作的我們,不愛面對一堆的命令的操作,拿想要隨意操作所有東東,就想要提示登入的許可權 以root使用者登入就可以。但是,ubuntu預設並沒有以root使用者登入,so,我們需要做些配置,讓系統再啟動的時候直接以root使用者登入。ubuntu 12.04預設是不允許root登入的,在登...
Python使用者登陸
usr bin env python coding utf 8 auth dahlhin import sysuserinfo r userinfo.txt userlock r userlock.txt def user exist check user 檢查使用者是否存在 with open u...
vue router 使用者登陸
有些路由頁面需要使用者登陸之後才能訪問如 使用者中心 如果使用者沒有登陸就訪問這些頁面的話就應該轉換到登陸頁面,登陸成功之後在進入該頁面。需要用到的知識點有 h5中的會話儲存 sessionstorage vue router路由前置操作 路由元資訊 meta 在路由頁面中新增auth欄位資訊用於驗...