Saturday, 9 March 2013

Find Current Directory in ASP.NET c#/vb.NET

Find Current Directory in ASP.NET c#/vb.NET


In asp.net    Directory.CurrentDirectory  returns IIS process Location. In windows 7
C:\Program Files (x86)\Common Files\Microsoft Shared\DevServer\11.0 IISEXPRESS location

If you want to find current Location of your aspx page.

use this   
C#
 
 String curDir = MapPath(".");
                Response.Write(curDir+"<br/>");

VB.NET

Dim curDir As String =  MapPath(".")
                Response.Write(curDir+"<br/>")


Tags: Find Current Directory in ASP.NET c#,Find Current Directory in ASP.NET vb.NET