asp随机生成文件名的函数

来源:asp之家 时间:2009-02-11 13:41:00 

关于asp随机数的相关文章:

asp生成一个不重复的随机数字

8个asp生成随机字符的函数

<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>
标签:随机,文件名,函数
0
投稿

猜你喜欢

  • 基于Python3制作一个带GUI界面的小说爬虫工具

    2023-04-02 17:33:04
  • MySQL对于各种锁的概念理解

    2024-01-17 17:18:36
  • windows8.1下Apache+Php+MySQL配置步骤

    2023-06-06 17:59:16
  • 使用bandit对目标python代码进行安全函数扫描的案例分析

    2021-04-07 02:01:22
  • python中asyncore异步模块的实现

    2023-10-23 00:50:07
  • js实现九宫格布局效果

    2024-04-19 11:03:42
  • Python 带星号(* 或 **)的函数参数详解

    2023-04-25 22:36:40
  • ASP日期和时间函数用法详解

    2007-10-13 19:33:00
  • python字典get()方法用法分析

    2023-04-01 23:50:41
  • 学点简单的Django之第一个Django程序的实现

    2021-03-23 05:10:59
  • Go modules replace解决Go依赖引用问题

    2024-04-28 10:49:40
  • 基于python框架Scrapy爬取自己的博客内容过程详解

    2021-12-21 06:39:30
  • 176万!GPT-4发布详解如何查看OpenAI的下载量

    2021-11-26 22:02:51
  • Django解决frame拒绝问题的方法

    2023-04-13 22:00:06
  • Python实现的批量下载RFC文档

    2021-11-25 02:54:48
  • 对pandas通过索引提取dataframe的行方法详解

    2021-05-18 18:10:39
  • 菜单效果

    2020-08-16 04:45:01
  • 告别网页搜索!教你用python实现一款属于自己的翻译词典软件

    2023-08-08 17:46:58
  • Python的数据类型与标识符和判断语句详解

    2021-04-11 13:18:15
  • phpMyAdmin 2.10.2 配置方法

    2007-08-22 08:11:00
  • asp之家 网络编程 m.aspxhome.com