Link to home
Start Free TrialLog in
Avatar of bhchng
bhchng

asked on

[Help Needed] From ASP to ASP.NET(C#)

Dear all,

Need your expertise here. I am converting a ASP code to ASP.NET(C#). I am wondering if anybody have any idea on how to convert the following ASP code ? I am trying to list the folders inside a virtual directory. Thanks a lot in advance.


ASP Code:

Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(Server.Mappath("../.."))
strTopFolder = objFolder.Path & "\"
ASKER CERTIFIED SOLUTION
Avatar of AdrianJMartin
AdrianJMartin

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dotnet_programmer
dotnet_programmer

make sure to include "using System.IO" in your cs file.
also just in case you are wondering, the @ before the quotes (i.e. @"\") tells the compiler to ignore the break characters like \ in the string. Otherwise you would get an error compiling.