Hi all,
i have this code in the header of my page to read the first line of my html containing <h2> and then pull this out to be my page title but it doesn't seem to be working can anyone see why?
<%
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.GetFile("c:\Temp\page1.asp")
Set objTextStream = objFile.OpenAsTextStream(ForReading)
Do Until objTextStream.AtEndOfStream
strLine = LCase(objTextStream.ReadLine())
If InStr(strLine, "<h2>") Then
Exit Do
End If
Loop
Set objTextStream = Nothing
Set objFile = Nothing
Set objFSO = Nothing
strLine = Replace(strLine, "<h2>", "")
strLine = Replace(strLine, "</h2>", "")
%>
thanks
i have this code in the header of my page to read the first line of my html containing <h2> and then pull this out to be my page title but it doesn't seem to be working can anyone see why?
<%
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.GetFile("c:\Temp\page1.asp")
Set objTextStream = objFile.OpenAsTextStream(ForReading)
Do Until objTextStream.AtEndOfStream
strLine = LCase(objTextStream.ReadLine())
If InStr(strLine, "<h2>") Then
Exit Do
End If
Loop
Set objTextStream = Nothing
Set objFile = Nothing
Set objFSO = Nothing
strLine = Replace(strLine, "<h2>", "")
strLine = Replace(strLine, "</h2>", "")
%>
thanks