W
W1ld0ne [MCSD]
In VB6 dlls' I could get the path of the calling web site by using the COM+
class library and the ASP class library.
Does anyone have a clue how to do this in VB.Net
The objective is to have an xml file containing some data sitting inside a
web site. Now I want two or more sites to reside on the same server. I want
them to use the same dll's. To open the xml file, I need to supply a path to
it. How would I get this dll to automatically figure out the path to the xml
file.
Below is the function I have tried but It always hits the
System.Web.HttpException, even when it is called from an aspx file on a web
site.
Any help would be appreciated.
Thanks
David Taylor
Private Function BuildXMLFilePath() As String
Try
Try
Dim objWeb As New System.Web.HttpApplication
Dim sAppPath As String = objWeb.Request.ApplicationPath()
objWeb = Nothing
Return (sAppPath & "settings\config.xml")
Catch httpEx As System.Web.HttpException
Return ("e:\Molecule\web\settings\config.xml")
End Try
Catch ex As Exception
ex.Source = TypeName(Me) & ": BuildXMLFilePath(" & Err.Source & ")"
Throw ex
End Try
End Function
class library and the ASP class library.
Does anyone have a clue how to do this in VB.Net
The objective is to have an xml file containing some data sitting inside a
web site. Now I want two or more sites to reside on the same server. I want
them to use the same dll's. To open the xml file, I need to supply a path to
it. How would I get this dll to automatically figure out the path to the xml
file.
Below is the function I have tried but It always hits the
System.Web.HttpException, even when it is called from an aspx file on a web
site.
Any help would be appreciated.
Thanks
David Taylor
Private Function BuildXMLFilePath() As String
Try
Try
Dim objWeb As New System.Web.HttpApplication
Dim sAppPath As String = objWeb.Request.ApplicationPath()
objWeb = Nothing
Return (sAppPath & "settings\config.xml")
Catch httpEx As System.Web.HttpException
Return ("e:\Molecule\web\settings\config.xml")
End Try
Catch ex As Exception
ex.Source = TypeName(Me) & ": BuildXMLFilePath(" & Err.Source & ")"
Throw ex
End Try
End Function