加入收藏
联系我们
关于我们
 您现在的位置: 亿聪 >> 网络学院 >> 网络编程 >> ASP >> 正文  
  随机生成文件名的函数         ★★★
随机生成文件名的函数
[ 作者:yanek    转贴自:开发者俱乐部    点击数:2336    更新时间:2003/8/28    文章录入:亿聪 ]
<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>


  • 上一篇文章: 使用FSO按文件大小浏览文件目录并进行删除操作

  • 下一篇文章: 一段在asp中加密与解密对应的函数
  • 发表评论】【告诉好友】【打印此文】【关闭窗口
     最新5篇热点文章
  • Knoppix 4.0.2 免硬盘免安…[15139]

  • 通过ASP记录进行分页[19321]

  • ASP开发准则[11274]

  • ASP组件指南[11244]

  • ASP指南[11259]

  •  
     最新5篇推荐文章
  • Knoppix 4.0.2 免硬盘免安…[15139]

  • 如何让Win 2003系统更加安…[12506]

  • Nero超刻简明教程[33954]

  • PS商业实战-来杯茶,行吗?…[7089]

  • ASP深度揭密(下)[12234]

  •  
     相 关 文 章
    没有相关文章

      网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
        没有任何评论
    设为首页 | 加入收藏 | 关于我们 | 联系我们 | 友情链接 | 版权声明 | 管理登录
    Copyright © 2000-2022 Yicong.com.All Rights Reserved.
    亿聪 版权所有 E-mail: