用ASP随机产生随机数
<%
Function gen_key(digits)
'Create and define array
dim char_array(50)
char_array(0) = "0"
char_array(1) = "1"
char_array(2) = "2"
char_array(3) = "3"
char_array(4) = "4"
char_array(5) = "5"
char_array(6) = "6"
char_array(7) = "7"
char_array(8) = "8"
char_array(9) = "9"
char_array(10) = "A"
char_array(11) = "B"
char_array(12) = "C"
char_array(13) = "D"
char_array(14) = "E"
char_array(15) = "F"
char_array(16) = "G"
char_array(17) = "H"
char_array(18) = "I"
char_array(19) = "J"
char_array(20) = "K"
char_array(21) = "L"
char_array(22) = "M"
char_array(23) = "N"
char_array(24) = "O"
char_array(25) = "P"
char_array(26) = "Q"
char_array(27) = "R"
char_array(28) = "S"
char_array(29) = "T"
char_array(30) = "U"
char_array(31) = "V"
char_array(32) = "W"
char_array(33) = "X"
char_array(34) = "Y"
char_array(35) = "Z"
'Initiate randomize method for default seeding
randomize
'Loop through and create the output based on the the variable passed to
'the function for the length of the key.
do while len(output) < digits
num = char_array(Int((35 - 0 + 1) * Rnd + 0))
output = output + num
loop
'Set return
gen_key = output
End Function
'Write the results to the browser, currently setting a 13 digit key
response.write "<pre>" & gen_key(13) & "</pre>" & vbcrlf
%>
相关文档:
Dim xmlDoc
NewsConfigFile=server.MapPath("/test.xml")
Set xmlDoc=Server.CreateObject("msxml2.FreeThreadedDOMDocument.3.0")
If Not xmlDoc.load(NewsConfigFile) Then
'XmlDoc.loadxml "<?xml version=""1.0"" encoding=""gb2312""?><NewscodeInfo/>"
response.Write("不存在数据")
& ......
asp文件搜索
<%
'*************Set newsearch=new SearchFile '声明 *************
'*************newsearch.Folder="F:+E:"'传入搜索源*************
'*************newsearch.keyword="汇编" '关键词*************
'*************newsearch.Search &nbs ......
一、asp.net中导出Execl的方法:
在asp.net中导出Execl有两种方法,一种是将导出的文件存放在服务器某个文件夹下面,然后将文件地址输出在浏览器上;一种是将文件直接将文件输出流写给浏览器。在Response输出时,t分隔的数据,导出execl时,等价于分列,n等价于换行。
1、将整个html全部输出execl
此法将html中所有的内 ......
ASP与ActiveX控件交互实战(一)
关键字:ASP,ActiveX控件,数字签名,安全
ActiveX控件运行在客户端。我们可以获得客户端的一些信息,如IC卡的信息,客户端的验证等等。但是ActiveX控件也有许多缺点:客户端的部署很困难,如客户端不能正确下载,下载了 ......
LBound() 函数: 返回指定的数组维可用的最小下标。
UBound() 函数: 返回指定的数组维可用的最大下标。
InStr([start, ]string1, string2[, compare]) 返回字符或字符串在另一个字符串中第一次出现的位置
InStrRev()函数 返回某字符串在另一个字符串中最后出现的位置
CDate() 函数可把一个合法的日期和时间表达式转换为 ......