123 Eng

Engineering the engineers™


Latest Jobs   Forum Map

 


Home

Source Codes

Engineering Colleges

BE Students

Training  Reports (updated)

Seminar Reports (updated

Placement Papers (updated)

Forums

   Computer Science / IT

   Electronics

   Electrical

   Mechanical

   Chemical

   Civil

   CAT / MBA

   GMAT / Foreign MBA

Latest Jobs

Engineering Jobs / Technical Jobs

Management Jobs

Sitemap

About-Us

Terms of use

Displaying  Source Code(s)  
 

 
Title Function

--------------------------------------------------------------------------------

Description : The Title function returns a string representing the title of a web page. It specifically scans a web page looking for the title tags and returns whatever is in between. The required argument pathname is the full path to a web page [*.htm, *.html, *.asp, *.cfm, *.cgi, etc...].

example usage:
Writes the hard coded HTML title of the document "file.htm".
<% = Title(Server.MapPath("/file.htm")) %>
source code:
<%
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
%>

--------------------------------------------------------------------------------
 

 

Contribute content or training reports / feedback / Comments
job placement papers
All rights reserved copyright 123ENG