我不知道如何在ASP中打開文件。這是我的代碼不工作。如何在ASP中打開文件
<%
Dim vid_file
vid_file = Request.ServerVariables("APPL_PHYSICAL_PATH")& "cannon\pay\vid.dat"
Dim vkey_file
vkey_file = Request.ServerVariables("APPL_PHYSICAL_PATH")& "cannon\pay\vkey.dat"
dim fp1,f
set fp1 = Server.CreateObject("Scripting.FileSystemObject")
set f=fp1.OpenTextFile(Server.MapPath("vid_file"),8,true)
f.WriteLine("This text will be added to the end of file")
f.Close
set f=Nothing
set fp1=Nothing
'Single Variable Declarations
dim fp2,f2
set fp2 = Server.CreateObject("Scripting.FileSystemObject")
'fExists=FileSysObj.FileExists(vid_file)
set f2=fp2.OpenTextFile(Server.MapPath("vkey_file"),8,true)
'set TextStreamObj = fp2.OpenTextFile(vkey_file,1,true)
'TextStreamObj.WriteLine("This text will be added to the end of file")
f2.WriteLine("This text will be added to the end of file")
f2.Close
set f2=Nothing
set fp2=Nothing
%>
** **如何在它不工作?有沒有錯誤信息? –
@Cheran S :)你能不能查看這個天氣我錯了還是對嗎? http://pastebin.com/5Wqd6kk2 – php