'******************************************************** ' Purpose: To view HTTP HEADERS without using BROWSER ' Author : Prashant Nayak, Copy right (c) 2004 '******************************************************** ' Uses XMLHttp to retrieve HEADERS '************************************** Function RetrieveContent(site) Dim XmlHttp1 on error resume next set XmlHttp1 = CreateObject("MSXML2.XMLHTTP.3.0") if err.number>0 then set XmlHttp1 = CreateObject("MSXML2.XMLHTTP.4.0") end if XmlHttp1.Open "HEAD", site, False Call XmlHttp1.send RetrieveContent = XmlHttp1.getAllResponseHeaders 'XmlHttp1.responseText End Function ' Creates temp file for the HEADERS '************************************** Sub WriteContentToFlie(content1,textfilepath) if textFilePath ="" then textFilePath="c:\Temp\TempHttpHeaders.txt" end if dim filesys, filetxt Set filesys = CreateObject("Scripting.FileSystemObject") Set filetxt = filesys.CreateTextFile(textFilePath, True) call filetxt.write(content1) filetxt.close call ViewFile(textFilePath) End Sub ' Display content '************************************** Sub ViewFile(sfile) dim shellx set shellx=createobject("Shell.Application") call shellx.ShellExecute("notepad.exe", sfile, "", "open", "1") End Sub ' Main '*************************************** dim mySite mySite=InputBox("Enter URL to view Http Headers:" & vbcrlf & "(Author: Prashant Nayak)", "Http Header Viewer", "http://www.google.com") if mysite<>"" then dim content content=RetrieveContent(mySite) mySite=InputBox("Enter Path and FileName to write content" & vbcrlf & "(Author: Prashant Nayak)", "Http Header Viewer", "C:\Temp\Temp.txt") if mySite<>"" then WriteContentToFlie content,mysite end if end if