473,404 Members | 2,174 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

App.Path replacement

Hi,

in VB6 i use App.Path to determine the path my executable run from.
what is the VB.NET / framework replacement fot that?

TIA, z.
Nov 21 '05 #1
16 3283
Application.StartupPath

"z. f." <zi**@info-scopeREMSPAM.co.il> wrote in message
news:uu**************@TK2MSFTNGP12.phx.gbl...
Hi,

in VB6 i use App.Path to determine the path my executable run from.
what is the VB.NET / framework replacement fot that?

TIA, z.

Nov 21 '05 #2
Hi,

Application.StartupPath

--
Happy Coding!
Morten Wennevik [C# MVP]
Nov 21 '05 #3
Application.StartupPath

"z. f." <zi**@info-scopeREMSPAM.co.il> wrote in message
news:uu**************@TK2MSFTNGP12.phx.gbl:
Hi,

in VB6 i use App.Path to determine the path my executable run from.
what is the VB.NET / framework replacement fot that?

TIA, z.


Nov 21 '05 #4
Application.ExecutablePath (with filename) or
Application.StartupPath(without filename). I believe StartupPath directly
corresponds to VB6's App.Path.

hope that helps..
Imran.

"z. f." <zi**@info-scopeREMSPAM.co.il> wrote in message
news:uu**************@TK2MSFTNGP12.phx.gbl...
Hi,

in VB6 i use App.Path to determine the path my executable run from.
what is the VB.NET / framework replacement fot that?

TIA, z.

Nov 21 '05 #5
"z. f." <zi**@info-scopeREMSPAM.co.il> schrieb:
in VB6 i use App.Path to determine the path my executable run from.
what is the VB.NET / framework replacement fot that?


'Application.StartupPath', or more general (can be used in DLL projects
too):

\\\
Imports System.IO
Imports System.Reflection
..
..
..
Private Function ApplicationPath() As String
Return _
Path.GetDirectoryName([Assembly].GetExecutingAssembly().Location)
End Function
///

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 21 '05 #6
Herfried,

Nice done really an addition.

Cor
Nov 21 '05 #7
are you testing your random word generator application?
On Thu, 14 Oct 2004 17:17:12 +0200, "Cor Ligthert"
<no************@planet.nl> wrote:
Herfried,

Nice done really an addition.

Cor


Nov 21 '05 #8
LOL!

"ToddT" <tu********@maritzSPAM.com> wrote in message
news:hp********************************@4ax.com:
are you testing your random word generator application?
On Thu, 14 Oct 2004 17:17:12 +0200, "Cor Ligthert"
<no************@planet.nl> wrote:
Herfried,

Nice done really an addition.

Cor


Nov 21 '05 #9
Yours is better I saw makes much more words
Nov 21 '05 #10
> Herfried,

Nice done really an addition.

Seems that people think this is sarcastic, it is not, we normally see only
the Application.StartupPath I find this a nice addition to that.

Cor
Nov 21 '05 #11
Cor,

"Cor Ligthert" <no************@planet.nl> schrieb:
Nice done really an addition.

Seems that people think this is sarcastic, it is not, we
normally see only the Application.StartupPath I find this
a nice addition to that.


:-)

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 21 '05 #12
What about AppDomain.CurrentDomain.BasePath?

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:eA**************@TK2MSFTNGP14.phx.gbl...
"z. f." <zi**@info-scopeREMSPAM.co.il> schrieb:
in VB6 i use App.Path to determine the path my executable run from.
what is the VB.NET / framework replacement fot that?


'Application.StartupPath', or more general (can be used in DLL projects
too):

\\\
Imports System.IO
Imports System.Reflection
.
.
.
Private Function ApplicationPath() As String
Return _
Path.GetDirectoryName([Assembly].GetExecutingAssembly().Location)
End Function
///

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 21 '05 #13
"Stefan Simek" <si********@kascomp.blah.sk> schrieb:
What about AppDomain.CurrentDomain.BasePath?


What if you set up more than one appdomain in your application?

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 21 '05 #14
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:O1**************@TK2MSFTNGP11.phx.gbl...
"Stefan Simek" <si********@kascomp.blah.sk> schrieb:
What about AppDomain.CurrentDomain.BasePath?
What if you set up more than one appdomain in your application?


If you don't I guess it's usable.

If you do, it depends what exactly do you need to use.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 21 '05 #15
if your code is running inside a DLL then code:
Path.GetDirectoryName([Assembly].GetExecutingAssembly().Location)
will not give the same results as
'Application.StartupPath'
since it will return the DLL location while the other will give the
executable location, which i need.
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:eA**************@TK2MSFTNGP14.phx.gbl...
"z. f." <zi**@info-scopeREMSPAM.co.il> schrieb:
in VB6 i use App.Path to determine the path my executable run from.
what is the VB.NET / framework replacement fot that?


'Application.StartupPath', or more general (can be used in DLL projects
too):

\\\
Imports System.IO
Imports System.Reflection
.
.
.
Private Function ApplicationPath() As String
Return _
Path.GetDirectoryName([Assembly].GetExecutingAssembly().Location)
End Function
///

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 21 '05 #16
Then replace GetExecutingAssembly() with GetEntryAssembly() ;)

HTH,
Stefan

"z. f." <zi**@info-scopeREMSPAM.co.il> wrote in message
news:us****************@TK2MSFTNGP10.phx.gbl...
if your code is running inside a DLL then code:
Path.GetDirectoryName([Assembly].GetExecutingAssembly().Location)
will not give the same results as
'Application.StartupPath'
since it will return the DLL location while the other will give the
executable location, which i need.
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:eA**************@TK2MSFTNGP14.phx.gbl...
"z. f." <zi**@info-scopeREMSPAM.co.il> schrieb:
> in VB6 i use App.Path to determine the path my executable run from.
> what is the VB.NET / framework replacement fot that?


'Application.StartupPath', or more general (can be used in DLL projects
too):

\\\
Imports System.IO
Imports System.Reflection
.
.
.
Private Function ApplicationPath() As String
Return _
Path.GetDirectoryName([Assembly].GetExecutingAssembly().Location)
End Function
///

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>


Nov 21 '05 #17

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

53
by: Kerberos | last post by:
I followed Dan Cederholm's image replacement tutorial, to replace a header tag by a logo. The h1 is clickable if no CSS is applied but it I replace it by the logo, the area isn't clickable anymore...
3
by: Vibha Tripathi | last post by:
Hi Folks, I put a Regular Expression question on this list a couple days ago. I would like to rephrase my question as below: In the Python re.sub(regex, replacement, subject)...
70
by: Michael Hoffman | last post by:
Many of you are familiar with Jason Orendorff's path module <http://www.jorendorff.com/articles/python/path/>, which is frequently recommended here on c.l.p. I submitted an RFE to add it to the...
34
by: Reinhold Birkenfeld | last post by:
Hi, the arguments in the previous thread were convincing enough, so I made the Path class inherit from str/unicode again. It still can be found in CVS:...
20
by: Paul D. Boyle | last post by:
Hi all, There was a recent thread in this group which talked about the shortcomings of fgets(). I decided to try my hand at writing a replacement for fgets() using fgetc() and realloc() to read...
1
by: Dave | last post by:
I have two environments: DEV and PROD. In DEV I have two independent webs. In PROD one of the webs is the root and the other is a subweb of the root. Each enviornment has a different file system...
1
by: André | last post by:
I'm attempting to override a wxHtmlWindow method in order to pre-process the file before displaying it. I'm using a unicode version of wxPython. I don't think my problem are wxPython-specific, but...
1
by: lawrence k | last post by:
Want to replace the limit clause in a query, but can't get it right. What's wrong with this: $pattern = "(.*)limit (.*)"; $replacement = '$1'; $replacement .= "LIMIT $limit"; $replacement .=...
7
by: ApexData | last post by:
Hello I currently Link the FE/BE using the LinkTables Option and the Linked Table Manager. Any time I need to move the BE to another location, I have to go through this process over again. I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.