博文
文字向上移动(2007-06-04 13:50:00)
摘要:<style>.black12 {font-size:12px;color:#000000;}a.black12:link {font-size:12px;color:#000000;text-decoration:none;}a.black12:visited {font-size:12px;color:#000000;text-decoration:none;}a.black12:hover {font-size:12px;color:#000000;text-decoration:underline;}a.black12line:link {font-size:12px;color:#000000;text-decoration:underline;}a.black12line:visited {font-size:12px;color:#000000;text-decoration:underline;}a.black12line:hover {font-size:12px;color:#000000;text-decoration:none;}</style><TABLE border=1 width=200><TR> <TD><div id="marquees"><div class="details"><a href='http://www.sina.com.cn' target='_blank' class="black12 blackDot"><li>新浪</li></a><a href='http://www.baidu.com' target='_blank' class="black12 blackDot"><li>百度</li></a><a href='http://www.google.com' target='_blank' class="black12 blackDot"><li>google</li></a><a href='http://www.yahoo.com.cn' target='_......
动态生成文本框并获取其中的内容(2007-05-30 11:17:00)
摘要:<form name="form1" method="post" action="1.asp"><input type="text" name="num" size=5><input type="button" value="生成文本框" onclick="f()"><div id="test"></div><input type="submit" value="提交"></form><script language="javascript">function f(){ num=document.form1.num.value; var s=''; for(i=1;i<=num;i++) { s=s+"<input type=\"text\" name=\"text"+i+"\"><br>"; } document.getElementById("test").innerHTML=s;}</script>1.asp<% num=request.Form("num") For i=1 To num a=request.form("text"&i) response.write "text"&i&"="&a&"<br>" next%>......
博客中拖动模块代码(2007-05-30 10:44:00)
摘要:<html><head><title>移动的窗口</title><style>*{font-size:12px}.dragTable{ font-size:12px; border-top:1px solid #3366cc; margin-bottom: 10px; width:100%; background-color:#FFFFFF;}.dragTR{ cursor:move; color:#7787cc; background-color:#e5eef9;}td{vertical-align:top;}#parentTable{ border-collapse:collapse; letter-spacing:25px;}</style> <script defer> var draged=false; tdiv=null;function dragStart(){ ao=event.srcElement; if((ao.tagName=="TD")||(ao.tagName=="TR"))ao=ao.offsetParent; else return; draged=true; tdiv=document.createElement("div"); tdiv.innerHTML=ao.outerHTML; tdiv.style.display="block"; tdiv.style.position="absolute"; tdiv.style.filter="alpha(opacity=70)"; tdiv.style.cursor="move"; tdiv.style.width=ao.offsetWidth; tdiv.style.height=ao.offsetHeight; tdiv.style.top=getInfo(ao).top; tdiv.style.left=getInfo(......
asp无组件文件上传(2007-05-28 09:38:00)
摘要:文件上传组件:upload.asp<% Dim stream1,stream2,istart,iend,filename istart=1 vbEnter=Chr(13)&Chr(10)
function getvalue(fstr,foro,paths)'fstr为接收的名称,foro布尔false为文件上传,true 为普通字段,path为上传文件存放路径 if foro then getvalue="" istart=instring(istart,fstr)
istart=istart+len(fstr)+5 iend=instring(istart,vbenter+"-----------------------------") if istart>5+len(fstr) then getvalue=substring(istart,iend-istart) else getvalue="" end if else istart=instring(istart,fstr) istart=istart+len(fstr)+13 iend=instring(istart,vbenter)-1 filename=substring(istart,iend-istart) filename=getfilename(filename) 'CheckFileExt(fstr)''''''''''''''''''''''''''''''''''''''''''''''......
ajax用户注册代码(2007-05-23 22:23:00)
摘要:终于实现了ajax用户注册系统.。注册界面如上。源码下载地址:http://www.aspprogram.cn/soft.asp?id=12
index.html<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML> <HEAD> <TITLE> 用户注册 </TITLE> </HEAD> <style> <!-- body,td {font-size:12px;} input{background-color: #ffffff; color: #000000; font-family: tahoma; font-size: 12px; border: 1px #cccccc double} --> </style> <BODY> <script language=javascript> <!-- function checkUserName() { username=this.form1.username.value; var xmlhttp; try { xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {  ......
ajax+xml的asp查询代码(2007-05-18 10:56:00)
摘要:最近初学ajax,xml,现在发布一个ajax+xml的asp查询代码。数据库中表名ly,字段名y_username,y_message,y_timeindex.html<HTML> <HEAD> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <TITLE> My Documents </TITLE> </HEAD> <style> <!-- body {font-size:12px;} --> </style>
<BODY> <form name="form1" method="post"> <input type="text" name="search"> <input type="button" value="查询" onclick="javascript:f1()"> </form> <div id="disp"> </div> </BODY></HTML><script language="javascript">function f1(){ if(document.form1.search.value=="") { alert('请输入要查询的内容'); return false; }
var xmlhttp; var search; var s=""; search=document.form1.search.value; var xmlhttp; try { xmhttp=new ActiveXObject("Msxml2.XMLHTTP......
asp中获取字符串中的时间字符串(2007-05-14 14:41:00)
摘要:由于时间在字符串中的值不一致性,会出现以下几中格式的字符串,没有办法用left,right,mid直接来获取,所以想到用正则表达式来实现这个功能(只要将这个功能改一下,就可以获取其他格式的字符串。<%'str = "2007-01-01 12:12:12 问题 1234"'str="sdfd 01-01 12:12:12 问题" 'str="2007-01-01 12:12sdfdf" 'str="qqwq 01-01 13:14dddd"str="a2007-01-01sdddd"
patrn="(\d+[-\:\s])+\d+"Response.Write(RegExpTest(patrn,str))
Function RegExpTest(patrn, strng)Dim regEx, Match, Matches ' 建立变量。Set regEx = New RegExp ' 建立正则表达式。regEx.Pattern = patrn ' 设置模式。regEx.IgnoreCase = True ' 设置是否区分大小写。regEx.Global = True ' 设置全局替换。Set Matches = regEx.Execute(strng) ' 执行搜索。For Each Match in Matches ' 遍历 Matches 集合。RetStr = Match.ValueNextRegExpTest = RetStrend Function%>......
截字符串,汉字一个算两个字符,英文算一个字符(2007-05-09 09:03:00)
摘要:通常在显示新闻标题的时候,有时候标题中会出现汉字和英文共存,直接用left截字符串会出现两条新闻标题长度不一,使用这个函数可以解决这个问题。<%'**************************************************'函数名:gotTopic'作 用:截字符串,汉字一个算两个字符,英文算一个字符'参 数:str ----原字符串' strlen ----截取长度'返回值:截取后的字符串'**************************************************Function gotTopic(ByVal str, ByVal strlen) If str = "" Then gotTopic = "" Exit Function End If Dim l, t, c, i, strTemp str = Replace(Replace(Replace(Replace(str, " ", " "), """, Chr(34)), ">", ">"), "<", "<") l = Len(str) t = 0 strTemp = str strlen = CLng(strlen) For i = 1 To l c = Abs(Asc(Mid(str, i, 1))) I......
求字符串长度,汉字算两个字符,英文算一个字符(2007-05-08 17:59:00)
摘要:<%'**************************************************'函数名:strLength'作 用:求字符串长度。汉字算两个字符,英文算一个字符。'参 数:str ----要求长度的字符串'返回值:字符串长度'**************************************************Function strLength(str) On Error Resume Next Dim WINNT_CHINESE WINNT_CHINESE = (Len("中国") = 2) If WINNT_CHINESE Then Dim l, t, c Dim i l = Len(str) t = l For i = 1 To l c = Asc(Mid(str, i, 1)) If c < 0 Then c = c + 65536 If c > 255 Then &n......
实现登录后才能下载(2007-04-27 13:31:00)
摘要:通常想实现用户登录后,才可以下载某此文件,可以用cookies和session来解决用户是否登录,然后根据cookies和session里面记录的值来确定是否给予下载。但是这样做有一个缺点:如果别人知道那个文件的路径,在IE中直接输入路径地址就可以下载了,这样的结果并不是我们想要的。首先,我们要将保存文件的那个文件夹名字前加上#,为了防止从IE中下载此文件。index.html文件(用来提供下载)<a href="down.asp?u=789.rar">下载</a>
down.asp<!--#include file="download.asp"--><%Dim uu=request.querystring("u")downloadFile "./#soft/123.rar", u%>download.asp<%'author : lael 2006-2-20function downloadFile(downfile, downname)on error resume next
dlfile = server.MapPath(downfile)
Response.Buffer = TrueResponse.Clear
Set oStream = Server.CreateObject("ADODB.Stream")oStream.OpenoStream.Type = 1
Set fso = Server.CreateObject("Scripting.FileSystemObject")if not fso.FileExists(dlfile) then set fso = nothing oStream.Close Set oStream = nothing downloadFile = "error:1" exit functionend ifSet ofile = fso.GetFile(dlfile)filesize = ofile.size
oStream.LoadFromFile(dlfile)......
