【ASP FSO文件处理函数大全】教程文章相关的互联网学习教程文章

asp之自动闭合HTML/ubb标签函数 附简单注释

这最近在PJ的function库里看到的这个函数,感觉思路差了点,不过相对比较完美,只是闭合标签时的顺序问题,呵呵 修改一下数组arrTags里的各元素内容,可以达到闭合任何标签的功能。 在此,我给增加了一些注释,方便大家一起学习学习 代码如下:Function closeUBB(strContent) ************************************* 自动闭合UBB ************************************* Dim arrTags, i, OpenPos, ClosePos, re, strMatchs, j, Mat...

asp IsValidEmail 验证邮箱地址函数(email)

代码如下:'******************************************** '函数名:IsValidEmail '作 用:检查Email地址合法性 '参 数:email ----要检查的Email地址 '返回值:True ----Email地址合法 ' False ----Email地址不合法 '******************************************** Public Function IsValidEmail(Email) Dim names, name, I, c IsValidEmail = True names = Split(Email, "@") If UBound(names) <> 1 Then IsValidEmail = False: ...

asp是的日期转换为星座的函数

代码如下:function astro(birth) astro="" if birth="" or not isdate(birth) Then exit function birthmonth=month(birth) : if birthmonth<10 then birthmonth="0" & birthmonth birthday=day(birth) : if birthday<10 then birthday="0" & birthday birth=trim(birthmonth & birthday) 重整月日,0903型 rAstro=split("水瓶座*0120*0219#双鱼座*0220*0320#白羊座*0321*0420#金牛座*0421*0521#双子座*0522*0621#巨蟹座*0622*0722#...

ASP trim,ltrim,rtrim 去前后空格 函数

这个主要应用于,获取用户输入的时候,防止用户不小心,多输入了一个空格,导致验证无法通过,多用于用户名跟密码的,好多情况下,大家复制的winrar的解压密码,都会默认多输入一个空格,所以这个是需要注意的。在获取字符串时,用trim清理下前后的空格,对程序开发人员是个好习惯。使用方法: password=trim(request("password")) 代码如下:dim txttxt=" This is a beautiful day! " document.write(Trim(txt)) 输出:"This is a...

ASP 支持中文的len(),left(),right()的函数代码

比如一个汉字也只会算一个字节,在排版时如果全是汉字,好说,反正没什么差别,但是如果被操作的字符串有汉字又有英文字母时,就不方便了,以下三个函数可以代替ASP自带的相关函数。   也有注意的地方,如果用在循环中,因不变量“i”也是常用于循环的变量,执行以下函数时,“i”的值会发生变化,如果是调用他的循环中用到相同的变量,会产生未知的结果,请换用其它变量名。 以下用法和len(),left(),right()一样。 程序代码 代...

asp 数组 重复删除函数(脚本之家增强版)

因为要写个东西用到,所以百度了一下,居然有朋友乱写,而且比较多,都没有认真测试过,只对字符可以,但是对数字就不可以,而且通用性很差,需要修改才可以真正使用。没办法就自己写了,经过测试完全没有问题,而且思路很方便,代码很短,如下: 代码如下:<% function cxarraynull(cxstr1,cxstr2) if isarray(cxstr1) then cxarraynull = "对不起,参数1不能为数组" Exit Function end if if cxstr1 = "" or isempty(cxstr1) the...

防盗链接ASP函数

简单介绍下功能吧:使用了ASP的一个对象ServerVariables(服务器环境变量),通过这个环境变量可以获取到真正的下载地址再通过一些简单的VBS内置函数破坏其真正地址的完整性。达到欺骗下载软件的功能。现附上源码提供大家学习。 代码如下:<% FunctIon DownloadFIle(StrFIle) StrFIlename=StrFIle Response.Buffer=True Response.Clear Set S=Server.CreateObJect("ADODB.Stream") S.Open S.Type=1 on Error Resume Next Set Fso=S...

ASP UTF-8编码生成静态网页的函数

以下函数采用FSO对象,文件位置在FSO.ASP。FSO对象的文件编码属性只有三种,系统默认,Unicode,ASCII,并没有我们要的utf-8,所以一般中文系统上使用FSO对象生成的文件都是gb2312网页编码格式,无法生成UTF-8编码,因此,英文等拉丁语系和中文可以正常显示,但象俄语等非拉丁语系,页面就会出现乱码。 代码如下:function createfile(sfilename,scontent) set fso=server.CreateObject("scripting.filesystemobject") set f1=fso....

ASP 递归调用 已知节点查找根节点的函数

代码如下:Function getTreeRootId(pNodeId) getSQL = "select note_id,parent_id from [T_tree_demo] where note_id='"& pNodeId &"'" Set getRs = db.Execute(getSQL) If Not getRs.eof Then If Trim(getRs("parent_id")) = "0" Then getTreeRootId = Trim(getRs("note_id")) Exit Function Else getTreeRootId = getTreeRootId(Trim(getRs("parent_id"))) End If Else getTreeRootId = 0 Exit Function End If getRs.close Set g...

Asp 返回引用类型函数代码

代码如下:<% set studentinstance = CreateStudent() if not isnull(studentinstance) then Response.write("StudentId:"&studentinstance.StudentId&"<Br/>") Response.write("StudentName:"&studentinstance.StudentName&"<Br/>") end if Function CreateStudent() set stud = new Statudent stud.StudentId=123 stud.StudentName="Eric liu" set CreateStudent=stud End Function Class Statudent private id private name publ...

asp 正则实现清除html文本格式的函数代码

代码如下:<% '/* 函数名称:Zxj_ReplaceHtml ClearHtml '/* 函数语言:VBScript Language '/* 作  用:清除文件HTML格式函数 '/* 传递参数:Content (注:需要进行清除的内容) '/* 函数作者:张晓军(古城童话) QQ:382511147 '/* 函数说明:正则匹配(正则表达式)模式进行数据匹配替换 Function ClearHtml(Content) Content=Zxj_ReplaceHtml("&#[^>]*;", "", Content) Content=Zxj_ReplaceHtml("</?marquee[^>]*>", "", Content)...

ASP 获取文件扩展名函数getFileExt()

代码如下:<% 功能:取得文件扩展名 Function getFileExt(sFileName) getFileExt = Mid(sFileName, InstrRev(sFileName, ".") + 1) End Function %>

ASP GetRef 函数指针试探

GetRef 函数 返回一个指向一过程的引用,此过程可绑定某事件。 Set object.eventname = GetRef(procname) 参数 object 必选项。事件所关联的对象的名称。 eventname 必选项。要与函数绑定的事件的名称。 procname 必选项。该字符串中包含 Sub 或 Function 过程的名称,该过程与事件关联。 说明 GetRef 函数可以用来将 VBScript 过程 (Function 或 Sub) 与 DHTML (动态 HTML)页面中可用的任何事件联系在一起。DHTML 对象模型为不同...

asp 网站静态化函数代码html

代码如下:Function htmll(mulu,htmlmulu,FileName,filefrom,htmla,htmlb,htmlc,htmld) if mulu="" then mulu="/" if htmlmulu="" then htmlmulu="/" mulu=replace(SysRootDir&mulu, "//", "/") htmlmulu=replace(SysRootDir&htmlmulu, "//", "/") FilePath=Server.MapPath(mulu)&"\"&FileName Do_Url="http://" Do_Url=Do_Url&Request.ServerVariables("server_name")&htmlmulu&filefrom Do_Url=Do_Url&"?"&htmla&htmlb&"&"&htmlc&...

asp利用Split函数进行多关键字检索

如题:我写入关键字到数据库,多的时候用|隔开了,我提取再做相关文章搜索的时候,我怎么提取用|隔开的文字啊,这样我就好用关键字做搜索啊 回复: 代码如下:<script language="vbscript"> dim keywords,operator,operend,strsql keywords="服装|荷花|名牌|中国" strsql = "select * from table_name where" operator=" title LIKE %" operend="%" keywords=Join(Split(keywords,"|"),operend & " OR " & operator) document.writ...