473,387 Members | 1,650 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,387 software developers and data experts.

Question: How get current exe dir?

I have a settings file that is in the same dir as my local VB.NET exe
winform application.

From my winform application how do I reference the "current directory" to
access the file?

NOTE: I don't want to use Environment.CurrentDirectory because this exe is
launched locally from a website and Environment.CurrentDirectory doesn't
return to me the correct dir.

Thanks.
Nov 20 '05 #1
2 4369
I tried Application.StartupPath and it seems to work.

Thanks.

"VB Programmer" <gr*********@go-intech.com> wrote in message
news:O$**************@TK2MSFTNGP10.phx.gbl...
I have a settings file that is in the same dir as my local VB.NET exe
winform application.

From my winform application how do I reference the "current directory" to
access the file?

NOTE: I don't want to use Environment.CurrentDirectory because this exe is launched locally from a website and Environment.CurrentDirectory doesn't
return to me the correct dir.

Thanks.

Nov 20 '05 #2
* "VB Programmer" <gr*********@go-intech.com> scripsit:
I have a settings file that is in the same dir as my local VB.NET exe
winform application.


<http://groups.google.com/groups?selm=uqB7aj0zDHA.3416%40tk2msftngp13.phx.gb l>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #3

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

Similar topics

9
by: JustSomeGuy | last post by:
I have a class that looks something like this (Don't try to compile it, I haven't tested this) class KVP { string key; string value; list<KVP> sublist; };
2
by: Lisbeth952 | last post by:
I'm sorry if this question is so basic that it's bordering on inane. I'm trying to do a simple menu system where the links light up when you mouse over, which I've accomplished quite nicely with...
4
by: anonymous | last post by:
Thanks your reply. The article I read is from www.hakin9.org/en/attachments/stackoverflow_en.pdf. And you're right. I don't know it very clearly. And that's why I want to understand it; for it's...
7
by: JJ | last post by:
How do I set one field to have the updated timestamp, and another to have the created timestamp? I want to do this directly from code generated from DB Designer if possible?! JJ
9
by: David Eades | last post by:
Hi all Complete newbie here, so apologies if this is the wrong forum. I've been asked to use mysql and asp to make a simple bidding system (rather like a simple ebay), whereby users can use a...
7
by: DaBrain | last post by:
I can use some help here. I have been moving from Delphi/C++ Win32 Database Development (ADO) to C#.Net /ADO.NET the language is not the problem ADO.NET is however kicking my butt. I finally...
10
by: Franky | last post by:
I think I misread a post and understood that if I do: System.Windows.Forms.Cursor.Current = Cursors.WaitCursor there is no need to reset the cursor to Default. So I made all the reset...
11
by: Jack | last post by:
Hi, I was asked this question during an interview. It seems very simple but I don't know if there is a more efficient way. The question said, we have 2 arrays as follows A = B = As you...
7
by: CaptainBly | last post by:
Okay I've been spending lots of time on this and it's giving me a migraine so I go humble and ask the guru's here. I have several structs typedef struct vert { int x,y,z; struct vert *...
4
by: tonywh00t | last post by:
Hi everyone, I have a "simple" question, especially for people familiar with regex. I need to parse strings that have the form: 1:3::5:9 which indicates the set of integers {1 3 4 5 9}. In...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...

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.