隨機(jī)生成文件名的函數(shù)
更新時(shí)間:2006年10月13日 00:00:00 作者:
<html>
<meta http-equiv="Refresh" content="2">
<!--
Place this code into an ASP Page and run it!
-->
<code>
Random FileName Creation
<%
Function Generator(Length)
dim i, tempS, v
dim c(39)
tempS = ""
c(1) = "a": c(2) = "b": c(3) = "c": c(4) = "d": c(5) = "e": c(6) = "f": c(7) = "g"
c(8) = "h": c(9) = "i": c(10) = "j": c(11) = "k": c(12) = "l": c(13) = "m": c(14) = "n"
c(15) = "o": c(16) = "p": c(17) = "q": c(18) = "r": c(19) = "s": c(20) = "t": c(21) = "u"
c(22) = "v": c(23) = "w": c(24) = "x": c(25) = "y": c(26) = "z": c(27) = "1": c(28) = "2"
c(29) = "3": c(30) = "4": c(31) = "5": c(32) = "6": c(33) = "7": c(34) = "8": c(35) = "9"
c(36) = "-": c(37) = "_": c(38) = "@": c(39) = "!"
If isNumeric(Length) = False Then
Response.Write "A numeric datatype was not submitted to this function."
Exit Function
End If
For i = 1 to Length
Randomize
v = Int((39 * Rnd) + 1)
tempS = tempS & c(v)
Next
Generator = tempS
End Function
For i = 1 to 20
Randomize
x = Int((20 * Rnd) + 1) + 10
Response.Write Generator(x) & "<br>" & vbnewline
Next
%>
</code>
(出處:Viphot)
相關(guān)文章
JSP開(kāi)發(fā)之hibernate之單向多對(duì)一關(guān)聯(lián)的實(shí)例
這篇文章主要介紹了JSP開(kāi)發(fā)之hibernate之單向多對(duì)一關(guān)聯(lián)的實(shí)例的相關(guān)資料,希望通過(guò)本文能幫助到大家,讓大家實(shí)現(xiàn)這樣的功能,需要的朋友可以參考下2017-09-09
JAVA (Jsp)利用Google的Translate開(kāi)發(fā)API的代碼
上次我說(shuō)了用ASP,PHP,C#分別實(shí)現(xiàn)Google的Translate開(kāi)發(fā)一個(gè)API ( Tags:Google Translate API )2008-12-12
jsp+servlet+jdbc實(shí)現(xiàn)對(duì)數(shù)據(jù)庫(kù)的增刪改查
本篇文章主要介紹了jsp+servlet+jdbc實(shí)現(xiàn)對(duì)數(shù)據(jù)庫(kù)的增刪改查,小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧2017-01-01
使用jsp:include控制動(dòng)態(tài)內(nèi)容的方法
這篇文章主要介紹了使用jsp:include控制動(dòng)態(tài)內(nèi)容的方法,結(jié)合實(shí)例較為詳細(xì)的分析了JSP中include偽指令的功能、定義及使用技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下2015-11-11
JSP 自定義標(biāo)簽實(shí)現(xiàn)數(shù)據(jù)字典的實(shí)例
這篇文章主要介紹了JSP 自定義標(biāo)簽實(shí)現(xiàn)數(shù)據(jù)字典的實(shí)例的相關(guān)資料,這里實(shí)現(xiàn)這樣的功能,希望能幫助到大家,需要的朋友可以參考下2017-08-08

