Connecting Tech Pros Worldwide Forums | Help | Site Map

Help - ASP & public folder access

James
Guest
 
Posts: n/a
#1: Mar 30 '06
Hello All,

I'm trying to read the contents of a local folder and output the file names
as text (code below.) However, my browser freezes because of line: " set
folder = fso.GetFolder("c:\") " The code below should work however I'd be
enormously grateful if someone could either provide alternative code or
suggest a resolution to the freezing. James


<%
dim fso
set fso = Server.CreateObject( "Scripting.FileSystemObject")

dim folder
set folder = fso.GetFolder("c:\")

Response.Write( "<B>Directory: " & folder.Path & "</B><BR><BR>")
dim file
for each file in folder.Files
Response.Write( file.Name & "<BR>")
next
%>



Elton W
Guest
 
Posts: n/a
#2: Mar 30 '06

re: Help - ASP & public folder access



Hi James,

If you are using .NET (It's ASP.NET group.), you should look at classes such
as DirectoryInfo and FileInfo in System.IO namespace.

Or for ASP, you should post your question in

http://msdn.microsoft.com/newsgroups...&lang=en&cr=US

or

http://msdn.microsoft.com/newsgroups...&lang=en&cr=US

HTH

Elton Wang


"James" wrote:
[color=blue]
> Hello All,
>
> I'm trying to read the contents of a local folder and output the file names
> as text (code below.) However, my browser freezes because of line: " set
> folder = fso.GetFolder("c:\") " The code below should work however I'd be
> enormously grateful if someone could either provide alternative code or
> suggest a resolution to the freezing. James
>
>
> <%
> dim fso
> set fso = Server.CreateObject( "Scripting.FileSystemObject")
>
> dim folder
> set folder = fso.GetFolder("c:\")
>
> Response.Write( "<B>Directory: " & folder.Path & "</B><BR><BR>")
> dim file
> for each file in folder.Files
> Response.Write( file.Name & "<BR>")
> next
> %>
>
>
>[/color]
Patrick.O.Ige
Guest
 
Posts: n/a
#3: Mar 31 '06

re: Help - ASP & public folder access


James as Elton adviced move it to ASP.NET
and make your life easier.
Patrick
"James" <james.merry@ntlworld.com> wrote in message
news:8NRWf.38548$u31.2167@newsfe2-win.ntli.net...[color=blue]
> Hello All,
>
> I'm trying to read the contents of a local folder and output the file
> names as text (code below.) However, my browser freezes because of line: "
> set folder = fso.GetFolder("c:\") " The code below should work however I'd
> be enormously grateful if someone could either provide alternative code or
> suggest a resolution to the freezing. James
>
>
> <%
> dim fso
> set fso = Server.CreateObject( "Scripting.FileSystemObject")
>
> dim folder
> set folder = fso.GetFolder("c:\")
>
> Response.Write( "<B>Directory: " & folder.Path & "</B><BR><BR>")
> dim file
> for each file in folder.Files
> Response.Write( file.Name & "<BR>")
> next
> %>
>[/color]


Closed Thread