Trying to learn ASP I copied an easy example from a web site
Here is the ASP code
So, I upload this code to my web site to a directory called asp and I named the file 'my_first_asp.asp'
I also uploaded a text file called 'textfile.txt' to a directory called text
I run WebBrowser like this
WebBrowser1.Navigate "www.mywebsite.com/asp/my_first_asp.asp"
I get the following error message returned:
Microsoft VBScript runtime error '800a0035'
File not found
/asp/example1.asp, line 7
When I look at line 7 in the code it points to this line:
Set RS = FS.OpenTextFile(Server.MapPath("text") & "\textfile.txt",1)
Is the problem on my end or is the code I copied incorrect?
Here is the ASP code
Code:
<!DOCTYPE html>
<html>
<body>
<%
Set FS = Server.CreateObject("Scripting.FileSystemObject")
Set RS = FS.OpenTextFile(Server.MapPath("text") & "\textfile.txt",1)
While not rs.AtEndOfStream
Response.Write RS.ReadLine
Response.Write("<br>")
Wend
%>
<p>
<a href="text/textfile.txt"><img src="/images/happyface.gif"></a>
</p>
</body>
</html>
I also uploaded a text file called 'textfile.txt' to a directory called text
I run WebBrowser like this
WebBrowser1.Navigate "www.mywebsite.com/asp/my_first_asp.asp"
I get the following error message returned:
Microsoft VBScript runtime error '800a0035'
File not found
/asp/example1.asp, line 7
When I look at line 7 in the code it points to this line:
Set RS = FS.OpenTextFile(Server.MapPath("text") & "\textfile.txt",1)
Is the problem on my end or is the code I copied incorrect?