Re: getting an absolute path



<%@ page language="VB" %>
<script runat="server">
Public Sub Page_Load(Sender As System.Object, E As System.EventArgs)
Dim root as String = Server.MapPath("/")
Label1.Text = root
End Sub
</script>

<html xmlns="http://www.w3.org/1999/xhtml"; >
<head runat="server">
<title>Root Path</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="Label1" Runat="server" Text=""></asp:Label>
</div>
</form>
</body>
</html>

See it working at : http://asp.net.do/test/rootpath.aspx



Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"PJ6" <nobody@xxxxxxxxxxx> wrote in message news:OFyfhZ66FHA.632@xxxxxxxxxxxxxxxxxxxxxxx
> Is it possible to get the absolute path (i.e. C:\inetpub\wwwroot) of the IIS root
> directory?


.



Relevant Pages

  • Re: .NET 1.1 Virtual Directory in a .NET 2.0 Website
    ... Juan T. Llibre, asp.net MVP ... asp.net faq: http://asp.net.do/faq/ ... John Timney (MVP) ... IIS webs will always inherit from the root node. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: System error 1326 has occurred - Logon failure:
    ... "Pegasus (MVP)" wrote: ... I have try ip but still cant, when i enable the guest user account ... What will be the root cause, ...
    (microsoft.public.windows.server.general)
  • Re: .NET 1.1 Virtual Directory in a .NET 2.0 Website
    ... John Timney (MVP) ... I expected to be able to inherit settings. ... I thought I was supposed to be able to have a 1.1 virtual directory ... IIS webs will always inherit from the root node. ...
    (microsoft.public.dotnet.framework.aspnet)
  • searching recursively through directories
    ... I am writing some code to locate files in a given root ... Dim colFiles As Collection ... Set colFiles = New Collection ... Public Sub GetFiles(ByRef poLocatedFiles As Collection, ...
    (microsoft.public.vb.general.discussion)
  • Re: Developing multiple applications
    ... >> create an application in the root directory. ... >> ASP.NET MVP ... >> Foros de ASP.NET en Español ... >> Ven, y hablemos de ASP.NET... ...
    (microsoft.public.dotnet.framework.aspnet)

Loading