C
cwl
I want to get the content of a webpage containing plain text and write
the content to a text file. My code looks like this:
Set xmlhttp = CreateObject("Microsoft.XMLHTTP")
xmlhttp.setRequestHeader "Content-type","text/txt"
xmlhttp.Open "get", "http://www.mysite.com/default.asp", False
xmlhttp.Send
text = xmlhttp.responseText
dim fs, fname
set fs=Server.CreateObject("Scripting.FileSystemObject")
set fname=fs.CreateTextFile("c:\test.txt",true)
fname.WriteLine(text)
fname.Close
set fname=nothing
set fs=nothing
The first and second part of the code runs fine if they are executed in
seperate files. So the text is retrieved and it's possible to write a
text file to the server.
But when they are combined in one file - which they of course have to
be - I'm prompted to logon on the server! And the file containing the
above script is suddenly inaccessible. I'm only able to delete it from
the webserver.
Does anyone have a clue why this happens?
The script runs on IIS 6.
the content to a text file. My code looks like this:
Set xmlhttp = CreateObject("Microsoft.XMLHTTP")
xmlhttp.setRequestHeader "Content-type","text/txt"
xmlhttp.Open "get", "http://www.mysite.com/default.asp", False
xmlhttp.Send
text = xmlhttp.responseText
dim fs, fname
set fs=Server.CreateObject("Scripting.FileSystemObject")
set fname=fs.CreateTextFile("c:\test.txt",true)
fname.WriteLine(text)
fname.Close
set fname=nothing
set fs=nothing
The first and second part of the code runs fine if they are executed in
seperate files. So the text is retrieved and it's possible to write a
text file to the server.
But when they are combined in one file - which they of course have to
be - I'm prompted to logon on the server! And the file containing the
above script is suddenly inaccessible. I'm only able to delete it from
the webserver.
Does anyone have a clue why this happens?
The script runs on IIS 6.