Asp生成13位隨機(jī)字符串_ASP教程
教程Tag:暫無Tag,歡迎添加,賺取U幣!
推薦:ASP+AJAX做類似google的搜索提示主要要文件有: Index.html實(shí)現(xiàn)功能,一個(gè)文本框,輸入內(nèi)容并實(shí)現(xiàn)提示 search.asp查詢功能,讓文本框輸入的內(nèi)容在數(shù)據(jù)庫中查詢,然后返回給客戶端 conn.asp數(shù)據(jù)庫連接功能,實(shí)現(xiàn)與數(shù)據(jù)庫相連 xmlhttp.jsAJAX核心部分,用來把客戶端的數(shù)據(jù)傳給服務(wù)端,再把服務(wù)端的數(shù)據(jù)
<html><title>
</title>
<body>
<%
Function gen_key(digits)
’定義并初始化數(shù)組
dim char_array(80)
’初始化數(shù)字
For i = 0 To 9
char_array(i) = CStr(i)
Next
’初始化大寫字母
For i = 10 To 35
char_array(i) = Chr(i + 55)
Next
’初始化小寫字母
For i = 36 To 61
char_array(i) = Chr(i + 61)
Next
Randomize Timer’初始化隨機(jī)數(shù)生成器。
do while len(output) < digits
num = char_array(Int((62 - 0 + 1) * Rnd + 0))
output = output + num
loop
’設(shè)置返回值
gen_key = output
End Function
’把結(jié)果返回給瀏覽器
response.write "本實(shí)例生成的十三位隨機(jī)字符串為:"
response.write "<center>"
response.write gen_key(13)
response.write "</center>"
%>
</body>
</html>
分享:如何用Asp取得數(shù)據(jù)庫中所有表名和字段名% set rs=server.CreateObject(adodb.recordset) db= db.mdb '只要直接更改數(shù)據(jù)庫名稱就能夠看到效果了。 set conn=server.CreateObject(adodb.connection) connstr=Provider=Microsoft.Jet.OLEDB.4.0;Data Source= Server.MapPath(db) conn.open c
相關(guān)ASP教程:
- asp FSO 讀寫文件本文件實(shí)現(xiàn)代碼
- asp中isNull、isEmpty和空字符串的區(qū)別
- asp獲取用戶真實(shí)IP地址的方法
- asp連接sqlserver數(shù)據(jù)庫實(shí)現(xiàn)代碼
- asp中正則表達(dá)式過濾html代碼函數(shù)
- asp中g(shù)et post提交表單區(qū)別
- 網(wǎng)頁模板:ASP內(nèi)建對象Request
- xmlhttp的open方法使用詳解
- ASP的常用的自定義函數(shù)大全
- asp中用for循環(huán)的一個(gè)小技巧
- eWebEditor v3.8 列目錄
- ASP無組件分頁實(shí)現(xiàn)思路及代碼
- 相關(guān)鏈接:
- 教程說明:
ASP教程-Asp生成13位隨機(jī)字符串
。