Fejl ved skrivning til tekstfil ?????
Hej dette nedenfor henter en sides client-side source
kode.
Dernæst putter jeg det ind i en variabel som så
lagres i
en tekstfil.
Dog vil den ikke skrive til filen og jeg får fejl
meddelelser.
Koden følger
Først fejl meddelelsen...
Serverobjekt fejl \'ASP 0177 : 800a0005\'
Server.CreateObject blev ikke udført
/getit.asp, linje 31
00000000
Linje 31 er denne her.....
TSO.write (strTekst)
%
Response.Buffer = True
Dim objXMLHTTP, xml
\' Create an xmlhttp object:
Set xml = Server.CreateObject(\"Microsoft.XMLHTTP\")
\' Or, for version 3.0 of XMLHTTP, use:
\' Set xml = Server.CreateObject(\"MSXML2.ServerXMLHTTP\")
\' Opens the connection to the remote server.
xml.Open \"GET\", \"http://www.lycos.dk\", False
\' Actually Sends the request and returns the data:
xml.Send
\'Display the HTML both as HTML and as text
response.write xml.responseText
strTekst=xml.responseText
\' Set up Constants
Const ForWriting = 2 \' Input OutPut mode
Const Create = True
\' Dimension local variables
Dim MyFile
Dim FSO \' FileSystemObject
Dim TSO \' TextStreamObject
\' always use MapPath function to get the Physical Path of file
MyFile = Server.MapPath(\"Welcome.txt\")
Set FSO = Server.CreateObject(\"Scripting.FileSystemObject\")
Set TSO = FSO.OpenTextFile(MyFile, ForWriting, Create)
TSO.write (strTekst)
\' Vbcrlf is next line character
TSO.write \"This is Second line in this text file\" & vbcrlf
\' Now Function will write local time
TSO.write \"Writen by devasp visitor at \" & Now()
TSO.WriteLine \"\"
Response.Write \" Three lines are writen to textfile.txt <br>\"
Response.Write \" Local time at server is \" & Now()
\' close TextStreamObject and
\' destroy local variables to relase memory
TSO.close
Set TSO = Nothing
Set FSO = Nothing
Set xml = Nothing
%>