get current directory

  • Thread starter Thread starter Poppy
  • Start date Start date
P

Poppy

Whenever I use "Directory.getcurrentdirectory" I always get
"C:\WINDOWS\system32" despite the fact that the code is running from a
subdirectory of wwwroot.

Can someone help ?

How can I get the current directory on a code behind page ?
I dont want the full "C:\e.t.c. Just the current directory name.
 
* "Poppy said:
Whenever I use "Directory.getcurrentdirectory" I always get
"C:\WINDOWS\system32" despite the fact that the code is running from a
subdirectory of wwwroot.

Are you talking about a web application?
Can someone help ?

How can I get the current directory on a code behind page ?
I dont want the full "C:\e.t.c. Just the current directory name.

Try 'CurDir'...

Or do you want the application path?

\\\
Private Function ApplicationPath() As String
Return _
Path.GetDirectoryName([Assembly].GetExecutingAssembly().Location)
End Function
///
 
Back
Top