Hi Alphonse,
Here's one way to do it. Place these functions in your global.asax file.
Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
Dim di As System.IO.DirectoryInfo
di = System.IO.Directory.GetParent(Server.MapPath("web.config"))
Application("path") = di.FullName
End Sub
Sub Application_End(ByVal sender As Object, ByVal e As EventArgs)
'To get the string, just use Application("path")
Dim s As String = Application("path")
'Since you can't watch the application end event,
'this code writes the string to a file where you
'can see it. This is only for test purposes and
'you will need to temporarily grant the ASPNET
'account full permissions to the folder, in this
'case C:\Inetpub\wwwroot\test1.
Dim file As New
System.IO.StreamWriter("C:\Inetpub\wwwroot\test1\test.txt")
file.WriteLine(s)
file.Close()
End Sub
Does this answer your question?
Thank you, Mike
Microsoft, ASP.NET Support Professional
Microsoft highly recommends to all of our customers that they visit the
http://www.microsoft.com/protect site and perform the three straightforward
steps listed to improve your computer's security.
This posting is provided "AS IS", with no warranties, and confers no rights.
--------------------
Reply-To: "Alphonse Giambrone" <
[email protected]>
From: "Alphonse Giambrone" <
[email protected]>
Subject: Physical Application Path in Application_End
Date: Tue, 6 Jan 2004 15:59:25 -0500
Lines: 11
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <
[email protected]>
Newsgroups: microsoft.public.dotnet.framework.aspnet
NNTP-Posting-Host: ool-4352027f.dyn.optonline.net 67.82.2.127
Path: