Click to See Complete Forum and Search --> : Asp question


OPETH
04-15-2007, 11:50 AM
<%
dim fs,f,t,x
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.CreateTextFile("c:\test.txt")
f.write("Hello World!")
f.close

set t=fs.OpenTextFile("c:\test.txt",1,false)
do while t.AtEndOfStream<>true
x=t.Read(12)
loop
t.close
Response.Write("The last character is: " & x)
%>

set t=fs.OpenTextFile("c:\test.txt",1,false)What is this means "1" in line?

Jackbob
04-15-2007, 12:23 PM
1=ForReading - Open a file for reading. You cannot write to this file.
2=ForWriting - Open a file for writing.
8=ForAppending - Open a file and write to the end of the file.

Terrorke
04-16-2007, 02:21 AM
here's a link for it http://www.w3schools.com/asp/met_opentextfile.asp

Full Moon
04-16-2007, 02:28 AM
Hi everybody I am a new member and I am facing a problem in ASP
I wrote this if statement
if (String (Session ("MM_UserAuthorization"))=="Administrator");
{
(Response.Redirect("Admin.asp"))
}
else
{
(Response.Redirect("User.asp"));
}

And it gave this error when run it
Error Type:
Microsoft JScript compilation (0x800A03EA)
Syntax error
/dubai_municipality/User.asp, line 7
else


Plzzzzzzzz help me