date time dos name size attr filename ---------- -------- ------------ ----------- ------ ---------------------- 2003/01/13 03:15:14 51,712 A tclock.exe 2003/01/13 03:17:58 LANGJA~1.TCL 6,656 A langja.tclock 2003/01/13 02:58:46 TCDLL~1.TCL 100,352 A tcdll.tclock
Function FetchHtml(Url) Set WSHShell=WScript.CreateObject("WScript.Shell") SamAgent=WSHShell.RegRead("HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\User Agent")' UA Set WSHShell=Nothing SamAgent2= "Samurize Client Script http://www.samurize.com/"' Substitute User-Agent
On Error Resume Next Set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP") If Err <> 0 Then Err.Clear Set xmlhttp = CreateObject("Microsoft.XMLHTTP") End If
On Error Resume Next xmlhttp.Open "GET", Url, False xmlhttp.SetRequestHeader "User-Agent", SamAgent xmlhttp.SetRequestHeader "Sub-User-Agent", SamAgent2 xmlhttp.Send
If Err <> 0 Then Exit Function bin = xmlhttp.ResponseBody Set xmlhttp = Nothing
Set rs = CreateObject("ADODB.Recordset") rs.Fields.Append "txt", 200, 35000, &H00000080 rs.Open rs.AddNew rs.Fields("txt").AppendChunk bin FetchHtml = rs("txt").Value rs.Close Set rs = Nothing End Function