ASP常用函数收藏乱七八糟未整理版(51)
End If
tempcnt = Join(temparray, Chr(13)&Chr(10))
Set f = fso.CreateTextFile(server.mappath(filename), True)
f.Write tempcnt
End If
f.Close
Set f = Nothing
End Function
%>
20.使用FSO添加文件新行的函数
<%
Function FSOappline(filename, Linecontent)
Dim fso, f
Set fso = server.CreateObject("scripting.filesystemobject")
If Not fso.FileExists(server.mappath(filename)) Then Exit 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
%>
利用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 :::
'::: :::
':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
内容版权声明:除非注明,否则皆为本站原创文章。