摘要:
获得系统时间;取得来访用的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]