string = Title(pathname)
Example Usage:
Writes the hard coded HTML title of the document "file.htm".ASP Source Code:
<% = Title(server.mappath("/file.htm")) %>
<%
Private Function Title(byVal pathname)
dim objFSO, objFile, a, tmp, firstCt, secondCt
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(pathname, 1, False)
a = objFile.ReadAll()
objFile.Close
Set objFile = Nothing
Set objFSO = Nothing
firstCt = InStr(UCASE(a), "<TITLE>") + 7
secondCt = InStr(UCASE(a), "</TITLE>")
tmp = Mid( a, firstCt, secondCt - firstCt )
Title = CStr( Trim( tmp ) )
End Function
%>