Article View: dk.edb.internet.webdesign.asp
Article #53Re: Oprette en fil lokalt på clienten
From: Michael Kjeldbjerg
Date: Wed, 30 Oct 2002 08:25
Date: Wed, 30 Oct 2002 08:25
35 lines
2022 bytes
2022 bytes
Du kan skrive i en fil med nedenn�vnte program stump. Du skal have
rettigheder til at skrive i et bibliotek (directory) p� serveren. Hvis
du bor p� et webhotel, s� kan du ofte f� webhotellet til at tildele
skriveadgang til et enkelt bibliotek, hvor du s� kan dumpe dine
logfiler eller database....
/mik
' =============================================
' Skriv logfil
' =============================================
' Navn p� logfilen.
BasePath = Request.ServerVariables("APPL_PHYSICAL_PATH")
AsciiLogFile = BasePath + "logs\LogFileName.fil"
LogLineContent = "Indhold i linien"
' Skriv HeaderLinie i ControlFilen
Set objCtrlFso = Server.CreateObject("Scripting.FileSystemObject")
if objCtrlFso.FileExists(AsciiLogFile) then
' Skriv i logfilen, hvis den eksisterer
Set CtrlFile = objCtrlFso.OpenTextFile(AsciiLogFile, ForAppending)
CtrlFile.WriteLine LogLineContent
CtrlFile.close
Set CtrlFile = nothing
else
Set CtrlFile = objCtrlFso.CreateTextFile(AsciiLogFile, True)
CtrlFile.WriteLine LogLineContent
CtrlFile.close
Set CtrlFile = nothing
end if
Set objCtrlFso = nothing
Technical Details
Message-ID:
<f42ba5e1.0210300025.dfd2700@posting.google.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mailReferences:
<caf7c8a0.0210162320.22631212@posting.google.com>Show Full Headers
Complete Article Headers
X-Google-Language: DANISH,ASCII X-Google-Thread: ff435,5e12cf337ee38825 X-Google-Attributes: gidff435,public X-Google-ArrivalTime: 2002-10-30 00:25:13 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mail From: mkjeldbjerg@vip.cybercity.dk (Michael Kjeldbjerg) Newsgroups: dk.edb.internet.webdesign.asp Subject: Re: Oprette en fil lokalt på clienten Date: 30 Oct 2002 00:25:12 -0800 Organization: http://groups.google.com/ Lines: 35 Message-ID: <f42ba5e1.0210300025.dfd2700@posting.google.com> References: <caf7c8a0.0210162320.22631212@posting.google.com> NNTP-Posting-Host: 212.242.237.116 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1035966312 30769 127.0.0.1 (30 Oct 2002 08:25:12 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 30 Oct 2002 08:25:12 GMT