首页 美女贴图 网络日记 重庆租房 搜索指南 网络电视 飘网音乐 飘网博客 精彩网址 友情链接 飘网地图 本站留言
飘网中国
专题:网络营销 | 网站设计 | QQ技巧 | 搜索优化 | 菜鸟进阶 | 病毒攻防 | 网络技术 | 系统应用 | 本站作品 | 常用软件 | 工具软件 |
飘网中国>>网站设计>>正文

ASP常用的经典代码(不断更新)

编辑:flymorn 来源: 更新:2006-4-15 点击:
【字体:

摘要:获得系统时间;取得来访用的IP;获得系统,浏览器版本;去除IE混动条;进入网站,跳出广告;随机数;向上混动代码;自动关闭网页;随机背景音乐;自动刷新本页面……
关键字:ASP 代码 
正文:
xit function
set f = fso.opentextfile(server.mappath(filename),8,1)
f.write chr(13)&chr(10)&Linecontent
f.close
set f = nothing
end function
21.读文件最后一行的函数
function FSOlastline(filename)
dim fso,f,temparray,tempcnt
set fso = server.createObject("scripting.filesystemobject")
if not fso.fileExists(server.mappath(filename)) then exit function
set f = fso.opentextfile(server.mappath(filename),1)
if not f.AtEndofStream then
tempcnt = f.readall
f.close
set f = nothing
temparray = split(tempcnt,chr(13)&chr(10))
FSOlastline = temparray(ubound(temparray))
end if
end function
22.利用FSO取得Bmp,JPG,PNG,GIF文件信息(大小,宽、高等)
<%
::: Bmp, GIF, JPG and PNG :::  
::: This function gets a specified number of bytes from any :::
::: file, starting at the offset (base 1) :::
::: :::
::: Passed: :::
::: flnm => Filespec of file to read :::
::: offset => Offset at which to start reading :::
::: bytes => How many bytes to read :::
::: :::
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
function GetBytes(flnm, offset, bytes)
Dim objFSO
Dim objFTemp
Dim objTextStream
Dim lngSize
on error resume next
Set objFSO = createObject("Scripting.FileSystemObject") 

 First, we get the filesize
Set objFTemp = objFSO.GetFile(flnm)
lngSize = objFTemp.Size
set objFTemp = nothing
fsoForReading = 1
Set objTextStream = objFSO.OpenTextFile(flnm, fsoForReading)
if offset > 0 then
strBuff = objTextStream.Read(offset - 1)
end if
if bytes = -1 then  Get All!
GetBytes = objTextStream.Read(lngSize) ReadAll
else
GetBytes = objTextStream.Read(bytes)
end if
objTextStream.Close
set objTextStream = nothing
set objFSO = nothing
end function 

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::: :::
::: Functions to convert two bytes to a numeric value (long) :::
::: (both little-endian and big-endian) :::
::: :::
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
function lngConvert(strTemp)
lngConvert = clng(
[1][2][3][4][5][6][7][8][9]
上一篇:ASP连接数据库的全能代码
下一篇:如何防止ASP木马在服务器上运行
最新文章 更多
推荐文章 更多
热门文章 更多
© 2005-2010 飘网中国 版权所有
站长邮箱:①LCC-749AT163.com ②FlymornATgmail.com(AT改为@)
如转载时,请注明出处;本站部分资源来自网络,如有侵权,请来信说明;飘易文章系统 HTML版.
渝ICP备05000119号