C 做的登入介面包含驗證碼

2021-07-03 05:24:24 字數 1980 閱讀 1984

登入介面如下所示:

using system;

using system.collections

.generic

;using system.componentmodel

;using system.data

;using system.drawing

;using system.linq

;using system.text

;using system.windows

.forms

;using system.media

;namespace 登入

static string str1 = ""

; public static void playmusic()

private void login_click(object sender, eventargs e)

else

messagebox.show("驗證碼錯誤");

}else

}else if (rdoteacher.checked)

else

messagebox.show("驗證碼錯誤");

}else}}

else

}private void reset_click(object sender, eventargs e)

//製作驗證碼

private void picturebox1_click(object sender, eventargs e)

str1 = string.copy(str);

bitmap bmp = new bitmap(120, 40);

graphics g = graphics.fromimage(bmp);

//隨機生成數字

for (int i = 0

; i < 5; i++)

;color cl = ;

g.drawstring(str[i].tostring(), new font(fonts[r.next(0, 5)], 20, fontstyle.bold), new solidbrush(cl[r.next(0, 5)]), p);

}//繪製直線識別障礙

for (int i = 0

; i < 20; i++)

for (int i = 0

; i < 500; i++)

//將bmp鑲嵌到picturbox中去

picturebox1.image = bmp;

}private void form1_load(object sender, eventargs e)

str1 = string.copy(str);

bitmap bmp = new bitmap(120, 40);

graphics g = graphics.fromimage(bmp);

//隨機生成數字

for (int i = 0

; i < 5; i++)

;color cl = ;

g.drawstring(str[i].tostring(), new font(fonts[r.next(0, 5)], 20, fontstyle.bold), new solidbrush(cl[r.next(0, 5)]), p);

}//繪製直線識別障礙

for (int i = 0

; i < 20; i++)

for (int i = 0

; i < 500; i++)

//將bmp鑲嵌到picturbox中去

picturebox1.image = bmp;

}private void timer1_tick(object sender, eventargs e)}}

沒有連線資料庫

利用jQuery做登入介面的驗證碼

主要是為了有效防止機器惡意註冊,對某乙個特定已註冊使用者用特定程式暴力破解方式進行不斷的登陸嘗試。驗證碼是現在很多 註冊 登入時必填的,雖然對使用者可能有點麻煩,但是對 社群來說這個功能還是很有必要,也很重要,不少 為了防止使用者利用機械人自動註冊 登入 灌水,都採用了驗證碼技術。還有在一方面會避免...

登入驗證碼C

一.新建乙個checkcode.aspx using system using system.data using system.configuration using system.collections using system.web using system.web.security usi...

基本的登入驗證碼

該驗證碼需要在後台去匹配驗證,可以選擇用json。如下 function check 指定處理的路徑 獲得返回值 重新整理驗證碼 function refresh obj 驗證碼tr 驗證碼 後台action private jsonobject json json json new jsonobj...