Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Reading File From Server

Reply
Thread Tools

Reading File From Server

 
 
Arpan
Guest
Posts: n/a
 
      09-30-2003
Consider the following code snippet:

<%
Dim objFSO,objOpenFile,strPath

strPath=Server.MapPath("ADList1.txt")
Set objFSO=Server.CreateObject("SCRIPTING.FILESYSTEMOB JECT")
Set objOpenFile=objFSO.OpenTextFile(strPath,1)
Do While Not objOpenFile.AtEndOfStream
Response.Write(objOpenFile.ReadLine() & "<br>")
Loop
objOpenFile.Close
Set objOpenFile=Nothing
Set objFSO=Nothing
%>

When I try to execute the above code, the code never gets executed. Neither
am I shown a script timeout error. After a lot of investigations, I
concluded that the code is not getting executed due to the presence of

Set objOpenFile=objFSO.OpenTextFile(strPath,1)

If I comment line nos. 3 to 8, then the code gets executed but as expected
without any output. Is this happening because of some permission which has
not been given to IIS 5.0? If so, what is it? I am working on Windows 2000
Professional.

Thanks,

Arpan


 
Reply With Quote
 
 
 
 
Tom Kaminski [MVP]
Guest
Posts: n/a
 
      09-30-2003
"Arpan" <> wrote in message
news:...
> Consider the following code snippet:
>
> <%
> Dim objFSO,objOpenFile,strPath
>
> strPath=Server.MapPath("ADList1.txt")
> Set objFSO=Server.CreateObject("SCRIPTING.FILESYSTEMOB JECT")
> Set objOpenFile=objFSO.OpenTextFile(strPath,1)
> Do While Not objOpenFile.AtEndOfStream
> Response.Write(objOpenFile.ReadLine() & "<br>")
> Loop
> objOpenFile.Close
> Set objOpenFile=Nothing
> Set objFSO=Nothing
> %>
>
> When I try to execute the above code, the code never gets executed.

Neither
> am I shown a script timeout error. After a lot of investigations, I
> concluded that the code is not getting executed due to the presence of
>
> Set objOpenFile=objFSO.OpenTextFile(strPath,1)
>
> If I comment line nos. 3 to 8, then the code gets executed but as expected
> without any output. Is this happening because of some permission which has
> not been given to IIS 5.0? If so, what is it? I am working on Windows 2000
> Professional.


Do you have NAV installed?

--
Tom Kaminski IIS MVP
http://www.iistoolshed.com/ - tools, scripts, and utilities for running IIS
http://mvp.support.microsoft.com/
http://www.microsoft.com/windowsserv...y/centers/iis/



 
Reply With Quote
 
 
 
 
Ray at
Guest
Posts: n/a
 
      09-30-2003
Possibly http://www.aspfaq.com/2180

Ray at work

"Arpan" <> wrote in message
news:...
> Consider the following code snippet:
>
> <%
>
> Set objFSO=Server.CreateObject("SCRIPTING.FILESYSTEMOB JECT")

objFSO=Nothing
> %>
>
> When I try to execute the above code, the code never gets executed.



 
Reply With Quote
 
Bob Barrows
Guest
Posts: n/a
 
      09-30-2003
Arpan wrote:
>
> Set objOpenFile=objFSO.OpenTextFile(strPath,1)
>
> If I comment line nos. 3 to 8, then the code gets executed but as
> expected without any output. Is this happening because of some
> permission which has not been given to IIS 5.0? If so, what is it? I
> am working on Windows 2000 Professional.
>

http://www.aspfaq.com/show.asp?id=2180

HTH,
Bob Barrows


 
Reply With Quote
 
Arpan
Guest
Posts: n/a
 
      09-30-2003
Thanks Ray & Bob for the URL. That was exactly the reason why I was having
this problem (I have been trying to get the solution since last 2
days.......tried out everything in IIS but without any results).

Thanks to Tom as well!!!

Once again, many many thanks to you three.

Regards,

Arpan

"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:#...
> Possibly http://www.aspfaq.com/2180
>
> Ray at work
>
> "Arpan" <> wrote in message
> news:...
> > Consider the following code snippet:
> >
> > <%
> >
> > Set objFSO=Server.CreateObject("SCRIPTING.FILESYSTEMOB JECT")

> objFSO=Nothing
> > %>
> >
> > When I try to execute the above code, the code never gets executed.

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Reading of file by next of map file and by next of file descriptor. =?ISO-8859-2?Q?Miros=B3aw?= Makowiecki C++ 1 07-10-2007 02:46 AM
Reading a file and resuming reading. Karim Ali Python 2 05-25-2007 02:04 PM
UnauthorizedAccessException when reading XML files (no problem when reading other file-types) blabla120@gmx.net ASP .Net 0 09-15-2006 02:08 PM
An Automated process of watching a network file folder, reading a file in it and deleting the file using ASP.NET ? Luis Esteban Valencia Muņoz ASP .Net 3 06-04-2005 10:56 AM
reading the DB vs. reading a text file...performance preference? Darrel ASP .Net 3 11-11-2004 02:27 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57