|
-
Nov 18th, 2001, 11:07 PM
#1
app.path equivalent in asp.net
application.startuppath works in vb.net, but it is not there in asp.net. Anyone got any ideas?
-
Nov 19th, 2001, 01:20 PM
#2
Frenzied Member
asp.net should be like asp
it automatically picks up the dir that your running your program from
so just put "test.aspx"
that should do it right
*the above is just a guess*
-
Nov 19th, 2001, 02:43 PM
#3
Good idea, but that does not work in .net. That will put it in the windows\system32 folder.
Thanks for the reply though.
-
Nov 19th, 2001, 08:16 PM
#4
you can add a referance to system.windows.forms which is the namespace where application.startupdir is located, but it does not work (maybe because an asp page is not an exe!). It gives the path to some strange location in the .net dll stuff
-
Jun 21st, 2002, 09:06 PM
#5
Addicted Member
I don't know that this will work in asp.net, but the proper replacement for app.path in VB.NET is System.Reflection.Assembly.GetExecutingAssembly.Location()
(This will return the File Name of your exe at the end)
Code:
Dim sPath As String
sPath = System.Reflection.Assembly.GetExecutingAssembly.Location()
I use this to find the folder:
Code:
Dim oPath As System.IO.Path
Dim sPath As String
sPath = System.Reflection.Assembly.GetExecutingAssembly.Location()
sPath = oPath.GetDirectoryName(sPath)
-Daryl
"Two More Rolls of Duct tape, and the world is mine!"
VB.NET Guru
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|