随笔分类 - ASP
摘要:txt文件是下面这样的, 一行一条数据,用逗号分隔 下面写出asp文件 <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!--#include file="inc/conn.asp" --> <% filespec=server.mappath("txt.txt&quo
阅读全文
摘要:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=g
阅读全文
摘要:用asp实现的去除内容的html标记和空格的实现代码 function nohtml(str) dim re Set re=new RegExp re.IgnoreCase =true re.Global=True re.Pattern="(/<.[^/<]*/>)" str=re.replace(str," ") re.Pattern="(/<//[^/<]*/>)" str=re.replace(str," ") str=replace(str," ",&
阅读全文
摘要:asp下过滤重复字符串的代码,有时候我们需要过滤一些重复的字符串,下面的代码即可解决这个问题 比如 1223445677777778aabbcccccccccc 经过过滤之后就是12345678abc <% '过滤重复 Function norepeat(Str) Dim RegEx If IsNull(Str) Or Str="" Then Exit Function Set RegEx=New RegExp RegEx.Global = True RegEx.IgnoreCase=True RegEx.MultiLine = True RegEx.patt
阅读全文
摘要:Function DRexPage(Str) Dim RegEx If IsNull(Str) Or Str="" Then Exit Function Set RegEx=New RegExp RegEx.IgnoreCase=True RegEx.pattern="(/&)?page=(/d)+" DRexPage=regEx.replace(Str,"") '(Str,"$1") Set RegEx=Nothing End Function 在分页系统里面用到的把page后面得东西都给丢掉
阅读全文
摘要:很多时候,我们采用原始的方法来解决一行内循环3张图片,如果上传者只上传了2张图片,那么2张图片间的距离会很大,因为缺少了一个<td> </td>. <table border="0" cellpadding="0" cellspacing="0"> <% dim rs,sqltext set rs = Server.CreateObject("adodb.recordset") sqltext="select * from [bigclass]&
阅读全文
摘要:主题: 怎样提取数据库用|隔开的字! 如题:我写入关键字到数据库,多的时候用|隔开了,我提取再做相关文章搜索的时候,我怎么提取用|隔开的文字啊,这样我就好用关键字做搜索啊 回复: <script language="vbscript"> dim keywords,operator,operend,strsql keywords="服装|荷花|名牌|中国" strsql = "select * from table_name where" operator=" title LIKE '%" ope
阅读全文
摘要:<%Call Com_CreatValidCode(Request.QueryString("tel")) Public Sub Com_CreatValidCode(pTel) '----------禁止缓存 Response.Expires = 0 Response.AddHeader "Pragma","no-cache" Response.AddHeader "cache-ctrol","no-cache" Response.ContentType = "Imag
阅读全文
摘要:最近在做论坛数据转换程序。例如表src, 表dest都有一个id自增长字段,(都是access数据库,起始值1 ,步长1) 表src中id,char两字段的值为 1、a 2、b 3、c 6、d 7、e 9、f 这样在将src中的记录插入表dest的时候会有麻烦,使得表dest中记录如下所示 1、a 2、b 3、c 4、d 5、e 6、f 这样造成dest和其它关联表中的数据难以对应 。因此有必要在向表dest中插入记录时 设置其id字段的起始值,然后再进行插入操作 在 http://access911.net/fixhtm/71FAB01E13DC.htm?tt= 发现如下文字: 通过以下语句
阅读全文
摘要:IE测试通过,FF有点小BUG Cls_Leibie.asp <% '数据库字段为类属性,添加、删除、修改、操作检查等函数为类的方法 Class Cls_Leibie Private nClassID,sClassName,nParentID,sParentPath,nDepth,nRootID,nChild,nOrderID,sFilePath '定义私有变量(类的属性,即数据库字段对应的变量) Private rs,sql,ErrorStr Private Sub Class_Initialize() ErrorStr="" '初始化错误信
阅读全文