




已阅读5页,还剩19页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
常用ASP特效(收藏) 0.设置滚动条颜色scrollbar-3d-light-color立体滚动条亮边的颜色(设置滚动条的颜色)scrollbar-arrow-color上下按钮上三角箭头的颜色scrollbar-base-color滚动条的基本颜色scrollbar-dark-shadow-color立体滚动条强阴影的颜色scrollbar-face-color立体滚动条凸出部分的颜色scrollbar-highlight-color滚动条空白部分的颜色scrollbar-shadow-color立体滚动条阴影的颜色1.获得系统时间:2.取得来访用的IP:3.获得系统,浏览器版本:window.document.write(版本:+navigator.appName+navigator.appVersion+ browser.)4.去除IE混动条: 5.进入网站,跳出广告:!- window.open(http:/www.XXXXXX.com,height=200,width=300,top=0,left=30);/ -6.随机数:N为可改变数7.向上混动代码:hhhhhhhhhhhhhhhhhhh8.自动关闭网页:本页10秒后自动关闭,请注意刷新页面9.随机背景音乐:bgsound src=mids/.mid loop=-1可以修改数字,限制调用个数,我这里是个10.自动刷新本页面: 11.ACCESS数据库连接:12.SQL数据库连接:13.用键盘打开网页代码:function ctlent(eventobject)if(event.ctrlKey & window.event.keyCode=13)|(event.altKey & window.event.keyCode=83)window.open(网址,)这里是Ctrl+Enter和Alt+S的代码 自己查下键盘的ASCII码再换就行14.让层不被控件复盖代码: 前面 后面 15.动网FLASH广告代码:16.VBS弹出窗口小代码:msgbox你还没有注册或登陆论坛,0,精品论坛location.href = login.asp16.使用FSO修改文件特定内容的函数function FSOchange(filename,Target,String)Dim objFSO,objCountFile,FiletempDataSet objFSO = Server.CreateObject(Scripting.FileSystemObject)Set objCountFile = objFSO.OpenTextFile(Server.MapPath(filename),1,True)FiletempData = objCountFile.ReadAllobjCountFile.CloseFiletempData=Replace(FiletempData,Target,String)Set objCountFile=objFSO.CreateTextFile(Server.MapPath(filename),True)objCountFile.Write FiletempData objCountFile.CloseSet objCountFile=NothingSet objFSO = NothingEnd Function17.使用FSO读取文件内容的函数function FSOFileRead(filename)Dim objFSO,objCountFile,FiletempDataSet objFSO = Server.CreateObject(Scripting.FileSystemObject)Set objCountFile = objFSO.OpenTextFile(Server.MapPath(filename),1,True)FSOFileRead = objCountFile.ReadAllobjCountFile.CloseSet objCountFile=NothingSet objFSO = NothingEnd Function18.使用FSO读取文件某一行的函数function FSOlinedit(filename,lineNum)if linenum ubound(temparray)+1 thenexit functionelseFSOlinedit = temparray(lineNum-1)end ifend ifend function19.使用FSO写文件某一行的函数function FSOlinewrite(filename,lineNum,Linecontent)if linenum ubound(temparray)+1 thenexit functionelsetemparray(lineNum-1) = lineContentend iftempcnt = join(temparray,chr(13)&chr(10)set f = fso.createtextfile(server.mappath(filename),true)f.write tempcntend iff.closeset f = nothingend function20.使用FSO添加文件新行的函数function FSOappline(filename,Linecontent)dim fso,fset fso = server.CreateObject(scripting.filesystemobject)if not fso.fileExists(server.mappath(filename) then exit functionset f = fso.opentextfile(server.mappath(filename),8,1)f.write chr(13)&chr(10)&Linecontentf.closeset f = nothingend function21.读文件最后一行的函数function FSOlastline(filename)dim fso,f,temparray,tempcntset fso = server.CreateObject(scripting.filesystemobject)if not fso.fileExists(server.mappath(filename) then exit functionset f = fso.opentextfile(server.mappath(filename),1)if not f.AtEndofStream thentempcnt = f.readallf.closeset f = nothingtemparray = split(tempcnt,chr(13)&chr(10)FSOlastline = temparray(ubound(temparray)end ifend function利用FSO取得BMP,JPG,PNG,GIF文件信息(大小,宽、高等) Filespec of file to read : offset = Offset at which to start reading : bytes = How many bytes to read : :function GetBytes(flnm, offset, bytes)Dim objFSODim objFTempDim objTextStreamDim lngSizeon error resume nextSet objFSO = CreateObject(Scripting.FileSystemObject) First, we get the filesizeSet objFTemp = objFSO.GetFile(flnm)lngSize = objFTemp.Sizeset objFTemp = nothingfsoForReading = 1Set objTextStream = objFSO.OpenTextFile(flnm, fsoForReading)if offset 0 thenstrBuff = objTextStream.Read(offset - 1)end ifif bytes = -1 then Get All!GetBytes = objTextStream.Read(lngSize) ReadAllelseGetBytes = objTextStream.Read(bytes)end ifobjTextStream.Closeset objTextStream = nothingset objFSO = nothingend function: : Functions to convert two bytes to a numeric value (long) : (both little-endian and big-endian) : :function lngConvert(strTemp)lngConvert = clng(asc(left(strTemp, 1) + (asc(right(strTemp, 1) * 256)end functionfunction lngConvert2(strTemp)lngConvert2 = clng(asc(right(strTemp, 1) + (asc(left(strTemp, 1) * 256)end function: : This function does most of the real work. It will attempt : to read any file, regardless of the extension, and will : identify if it is a graphical image. : : Passed: : flnm = Filespec of file to read : width = width of image : height = height of image : depth = color depth (in number of colors) : strImageType= type of image (e.g. GIF, BMP, etc.) : :function gfxSpex(flnm, width, height, depth, strImageType)dim strPNG dim strGIFdim strBMPdim strTypestrType = strImageType = (unknown)gfxSpex = FalsestrPNG = chr(137) & chr(80) & chr(78)strGIF = GIFstrBMP = chr(66) & chr(77)strType = GetBytes(flnm, 0, 3)if strType = strGIF then is GIFstrImageType = GIFWidth = lngConvert(GetBytes(flnm, 7, 2)Height = lngConvert(GetBytes(flnm, 9, 2)Depth = 2 (asc(GetBytes(flnm, 11, 1) and 7) + 1)gfxSpex = Trueelseif left(strType, 2) = strBMP then is BMPstrImageType = BMPWidth = lngConvert(GetBytes(flnm, 19, 2)Height = lngConvert(GetBytes(flnm, 23, 2)Depth = 2 (asc(GetBytes(flnm, 29, 1)gfxSpex = Trueelseif strType = strPNG then Is PNGstrImageType = PNGWidth = lngConvert2(GetBytes(flnm, 19, 2)Height = lngConvert2(GetBytes(flnm, 23, 2)Depth = getBytes(flnm, 25, 2)select case asc(right(Depth,1)case 0Depth = 2 (asc(left(Depth, 1)gfxSpex = Truecase 2Depth = 2 (asc(left(Depth, 1) * 3)gfxSpex = Truecase 3Depth = 2 (asc(left(Depth, 1) 8gfxSpex = Truecase 4Depth = 2 (asc(left(Depth, 1) * 2)gfxSpex = Truecase 6Depth = 2 (asc(left(Depth, 1) * 4)gfxSpex = Truecase elseDepth = -1end selectelsestrBuff = GetBytes(flnm, 0, -1) Get all bytes from filelngSize = len(strBuff)flgFound = 0strTarget = chr(255) & chr(216) & chr(255)flgFound = instr(strBuff, strTarget)if flgFound = 0 thenexit functionend ifstrImageType = JPGlngPos = flgFound + 2ExitLoop = falsedo while ExitLoop = False and lngPos lngSizedo while asc(mid(strBuff, lngPos, 1) = 255 and lngPos lngSizelngPos = lngPos + 1loopif asc(mid(strBuf, lngPos, 1) 195 thenlngMarkerSize = lngConvert2(mid(strBuff, lngPos + 1, 2)lngPos = lngPos + lngMarkerSize + 1elseExitLoop = Trueend ifloopif ExitLoop = False thenWidth = -1Height = -1Depth = -1elseHeight = lngConvert2(mid(strBuff, lngPos + 4, 2)Width = lngConvert2(mid(strBuff, lngPos + 6, 2)Depth = 2 (asc(mid(strBuff, lngPos + 8, 1) * 8)gfxSpex = Trueend ifend ifend function: Test Harness : To test, well just try to show all files with a .GIF extension in the root of C:Set objFSO = CreateObject(Scripting.FileSystemObject)Set objF = objFSO.GetFolder(c:)Set objFC = objF.Filesresponse.write For Each f1 in objFCif instr(ucase(f1.Name), .GIF) thenresponse.write & & & f1.DateCreated & & f1.Size & if gfxSpex(f1.Path, w, h, c, strType) = true thenresponse.write w & x & h & & c & colorselseresponse.write end ifresponse.write end ifNextresponse.write set objFC = nothingset objF = nothingset objFSO = nothing%24.点击返回上页代码:24.点击刷新代码:24.点击刷新代码2: 25.弹出警告框代码:26.状态栏信息27.背景色变换function BgButton()if (document.bgColor=#00ffff)document.bgColor=#ffffff;elsedocument.bgColor=#00ffff;28.点击打开新窗口29.分页代码:分页示例/点击第一页时响应:function PageFirst() document.MyForm.CurrentPage.selectedIndex=0;document.MyForm.CurrentPage.onchange();/点击上一页时响应:function PagePrior() document.MyForm.CurrentPage.selectedIndex-;document.MyForm.CurrentPage.onchange();/点击下一页时响应:function PageNext() document.MyForm.CurrentPage.selectedIndex+;document.MyForm.CurrentPage.onchange(); /点击最后一页时响应:function PageLast() document.MyForm.CurrentPage.selectedIndex=document.MyForm.CurrentPage.length-1;document.MyForm.CurrentPage.onchange();/选择第?页时响应:function PageCurrent() /Pages.asp是本程序的文件名document.MyForm.action=Pages.asp?Page=+(document.MyForm.CurrentPage.selectedIndex+1)document.MyForm.submit(); %IF rs.Eof THENResponse.Write(数据库中没有记录!)ELSE 指定当前页码If Request(CurrentPage)= Thenrs.AbsolutePage=1Elsers.AbsolutePage=CLng(Request(CurrentPage)End If 创建表单MyForm,方法为GetResponse.Write() Response.Write()设置翻页超链接if rs.PageCount=1 then Response.Write(第一页 上一页 下一页 最后一页 )else if rs.AbsolutePage=1 thenResponse.Write(第一页 上一页 )Response.Write(下一页 ) Response.Write(最后一页 ) else if rs.AbsolutePage=rs.PageCount thenResponse.Write(第一页 ) Response.Write(上一页 ) Response.Write(下一页 最后一页 )elseResponse.Write(第一页 ) Response.Write(上一页 ) Response.Write(下一页 ) Response.Write(&t;a href=java script:PageLast()最后一页 ) end ifend ifend if创建下拉列表框,用于选择浏览页码Response.Write(第) For i=1 to rs.PageCount if rs.AbsolutePage=i thenResponse.Write(&i&) 当前页码elseResponse.Write(&i&)end if Next Response.Write(页/共&rs.PageCount&页 共&rs.RecordCount&条记录) Response.Write()创建表格,用于显示Response.Write()Response.Write() Set Columns=rs.Fields 显示表头For i=0 to Columns.Count-1Response.Write()Response.Write(&Columns(i).name&) NextResponse.Write()显示内容For i=1 to rs.PageSize Response.Write() For j=0 to Columns.Count-1 Response.Write(&Columns(j)&) NextResponse.Write()rs.movenext i
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 康养养老社区创新创业项目商业计划书
- 家禽健康养殖技术创新创业项目商业计划书
- 智慧农垦数据分析平台创新创业项目商业计划书
- 织布上轴工5S管理考核试卷及答案
- 客运船舶驾驶员专业技能考核试卷及答案
- 道路危险货物运输员职业考核试卷及答案
- 空调器零部件制作工专业知识考核试卷及答案
- 飞机试飞设备安装调试工协同作业考核试卷及答案
- 微损伤下小管形态变化-洞察及研究
- 公共安全管理培训课件
- 打造卓越电信网络-优化技术引领业务增长
- 卫星通信技术在电力行业中的应用场景分析
- 黄旭华人物介绍
- 《医疗机构工作人员廉洁从业九项准则》解读
- 设备维护保养与维修操作手册
- 《支架外固定的护理》课件
- 建钢结构库房合同协议
- 2024-2030全球智能牙科诊所系统行业调研及趋势分析报告
- 通信系统建模与仿真(基于MWORKS) 课件 第2章 MWORKS 科学计算与系统建模仿真基础
- 热水承包合同协议
- 大数据治理与服务平台建设及数据服务运营实施技术方案
评论
0/150
提交评论