application.startuppath works in vb.net, but it is not there in asp.net. Anyone got any ideas?
Printable View
application.startuppath works in vb.net, but it is not there in asp.net. Anyone got any ideas?
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*
Good idea, but that does not work in .net. That will put it in the windows\system32 folder.
Thanks for the reply though.
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
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)