随笔分类 -  ASP

摘要:<%' 定义数据库连接字符串Dim connectionStringconnectionString = "Provider=sqloledb;Data Source=你的数据库服务器;Initial Catalog=你的数据库名;User Id=你的用户名;Password=你的密码;" ' 定义 阅读全文
posted @ 2024-09-19 23:15 黑旗君
摘要:<%'所有功能函数名如下:' StrLength(str) 取得字符串长度' CutStr(str,strlen) 字符串长度切割' CheckIsEmpty(tstr) 检测是否为空' isInteger(para) 整数检验' CheckName(str) 名字字符校验' CheckPasswo 阅读全文
posted @ 2024-09-19 23:13 黑旗君
摘要:<% Function vbsEscape(str) dim i,s,c,a s="" For i=1 to Len(str) c=Mid(str,i,1) a=ASCW(c) If (a>=48 and a<=57) or (a>=65 and a<=90) or (a>=97 and a<=12 阅读全文
posted @ 2021-07-30 16:03 黑旗君
摘要:有的时候我们要求用户一定要输入汉字的信息,比如姓名和地址。那么,如何判断一个字符是不是汉字呢?其实在asp中至少有两种方法: 一、直接将某字符用asc转为ascii码,如果是英文,他应该是0-127的范围,而汉字则是一个比较大的数字,所以可以使用以下代码来判断:if abs(asc(whichcha 阅读全文
posted @ 2021-07-25 10:54 黑旗君
摘要:1.文本框只能输入数字代码(小数点也不能输入) <input onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')" /> 2.只能输入数字,能输 阅读全文
posted @ 2020-08-09 21:55 黑旗君
摘要:function getmodule(arg) select case arg case "pinyin" aaa="123" %><!--#插入页--><% end selectend function 阅读全文
posted @ 2020-07-10 16:03 黑旗君
摘要:<%'//获取汉字的首字母 ,ANSII编码function getpychar(char) dim tmpp:tmpp=65536+asc(char) if(tmpp>=45217 and tmpp<=45252) then getpychar= "A" elseif(tmpp>=45253 an 阅读全文
posted @ 2020-07-08 22:29 黑旗君
摘要:<% ‘获取所有图片function GetImgS(str)'获取所有图片Set objRegExp1 = New RegexpobjRegExp1.IgnoreCase = True '忽略大小写objRegExp1.Global = True '全文搜索objRegExp1.Pattern = 阅读全文
posted @ 2019-11-23 11:17 黑旗君
摘要:1.获取文件格式 <%FullPath = theFile.Namefiletype= mid(FullPath,InStrRev(FullPath, ".")+1)'Response.Write f%> 阅读全文
posted @ 2019-06-05 20:03 黑旗君
摘要:bianli(Server.MapPath("/")+"\pic") InStrRev("abcd.jpg", ".") 计算出abcd.jpg中第一次出现.所在的位置是第几个字符=5 mid("abcd.jpg",1,4) 取前四位abcd mid("abcd.jpg",5) 从五位往后取(包括第 阅读全文
posted @ 2019-06-03 15:19 黑旗君
摘要:rs.movenext 将记录指针从当前的位置向下移一行rs.moveprevious 将记录指针从当前的位置向上移一行rs.movefirst 将记录指针移到数据表第一行rs.movelast 将记录指针移到数据表最后一行rs.absoluteposition=N 将记录指针移到数据表第N行rs. 阅读全文
posted @ 2019-03-29 16:03 黑旗君
摘要:ASP动态网页(网站)设计教程 阅读全文
posted @ 2019-03-25 17:43 黑旗君
摘要:在ASP中生成Word文件、Excel文件和Txt文件,参考了微软的官方文档,自己简单弄了下,基本可以实现了,不足之处,望指导!下面言归正传。 1、用ASP生成Word文档,代码示例: 01 <% 02 Response.ContentType = "application/msword" 03 R 阅读全文
posted @ 2019-03-17 17:25 黑旗君
摘要:Function RegImg(TheStr) Dim RegEx Set RegEx = New RegExp '建立正则表达对象。 RegEx.IgnoreCase =True ' 是否区分大小写,True为不区分且默认 RegEx.Global = True '全部匹配还是只匹配第一个 Reg 阅读全文
posted @ 2019-03-13 10:08 黑旗君
摘要:<% OPTION EXPLICIT const BASE_64_MAP_INIT = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" dim newline dim Base64EncMap(63) dim Ba 阅读全文
posted @ 2019-03-12 17:55 黑旗君
摘要:本站收录这篇文章通过ASP生成html纯静态页面的简单示例,详细解说文章中相关静态 asp 技术与知识,欢迎能给大家一些在这方面的支持和帮助!下面是详细内容: 原理:通过浏览器传送变量,如 http://127.0.0.1/shengcheng.asp?id=90 代码:if SaveFile("/ 阅读全文
posted @ 2019-02-23 23:37 黑旗君
摘要:<%Public Function BornVerifyCode() Randomize '设置随机因子 BornVerifyCode=Mid((Rnd * 1000000), 1, 4) '生成6位随机数,取高4位 End Function%>调用:<%=BornVerifyCode%><%Fun 阅读全文
posted @ 2019-02-23 23:34 黑旗君
摘要:以下是ASP获取服务器全部参数的列表说明,在做ASP网页时经常需要用到,特整理以供参考。 返回服务器地址<%=Request.ServerVariables("Url")%> 客户端提供的路径信息<%=Request.ServerVariables("Path_Info")%> 与应用程序元数据库路 阅读全文
posted @ 2019-02-20 15:25 黑旗君
摘要:Microsoft VBScript 编译器错误 错误 '' 缺少语句ActiveServerPages,ASP0126(0x80004005)-->找不到包含文件 MicrosoftOLEDBProviderforODBCDrivers(0x80040E21)-->sql语句出错(数据类型不匹配或 阅读全文
posted @ 2018-06-17 22:25 黑旗君
摘要:<% dim FileNameFileName="Excel.xls" '取得文件名,来自项目经理的指定,路径固定在某个虚拟路径中Dim conn, rsset conn=CreateObject("ADODB.connection")conn.Open "Driver={Microsoft Exc 阅读全文
posted @ 2018-06-11 09:23 黑旗君