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

VB.Net Equivalent to AppDir

I looked in the helps and I know that I've seen it before but I can't find
it now. I need to write a 'quickie' pgm that reads a file from the
directory where the .exe is located, so where should I point my
StreamReader? Is there an Assembly.LocationPath or some such?

Thanx!

--
TFWBWY...A
Dec 21 '05 #1
4 3401
Bryan,

Give:
System.Windows.Forms.Application.ExecutablePath()
a try. It should suit your needs.

Let us know if that covers it,
chrisj

System.Windows.Forms.Application.ExecutablePath()

"Bryan Dickerson" <tx******@netscape.net> wrote in message
news:O4**************@TK2MSFTNGP11.phx.gbl...
I looked in the helps and I know that I've seen it before but I can't find
it now. I need to write a 'quickie' pgm that reads a file from the
directory where the .exe is located, so where should I point my
StreamReader? Is there an Assembly.LocationPath or some such?

Thanx!

--
TFWBWY...A

Dec 21 '05 #2
"Bryan Dickerson" <tx******@netscape.net> schrieb:
I looked in the helps and I know that I've seen it before but I can't find
it now. I need to write a 'quickie' pgm that reads a file from the
directory where the .exe is located, so where should I point my
StreamReader? Is there an Assembly.LocationPath or some such?


Check out the code at:

<URL:http://dotnet.mvps.org/dotnet/code/application/#ApplicationPath>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Dec 21 '05 #3
dim dir_base_path As String = System.Windows.Forms.Application.StartupPath

"Bryan Dickerson" <tx******@netscape.net> ha scritto nel messaggio
news:O4**************@TK2MSFTNGP11.phx.gbl...
I looked in the helps and I know that I've seen it before but I can't find
it now. I need to write a 'quickie' pgm that reads a file from the
directory where the .exe is located, so where should I point my
StreamReader? Is there an Assembly.LocationPath or some such?

Thanx!

--
TFWBWY...A

Dec 21 '05 #4
Thanks to all (Chris Johnson & poldoj). I found it and it works!

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:uD*************@TK2MSFTNGP11.phx.gbl...
"Bryan Dickerson" <tx******@netscape.net> schrieb:
I looked in the helps and I know that I've seen it before but I can't find
it now. I need to write a 'quickie' pgm that reads a file from the
directory where the .exe is located, so where should I point my
StreamReader? Is there an Assembly.LocationPath or some such?


Check out the code at:

<URL:http://dotnet.mvps.org/dotnet/code/application/#ApplicationPath>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Dec 29 '05 #5

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

Similar topics

14
by: John | last post by:
Is there an equivalent of COM on Linux that I can get through Python. My need is to have some sort of language independent component framework. I can think of CORBA but I have to have a server...
2
by: Michael Foord | last post by:
Please pardon my ignorance on this one - but I'm not certain how the sign bt is treated in python bitwise operators. I've trying to convert a javascript DES encryption routine into python. ...
3
by: Robert Dodier | last post by:
Hello, Here's a thought that I'm sure has already occurred to someone else, I just can't find any record of it yet. An XML document is just a more verbose and clumsy representation of an...
1
by: Vannela | last post by:
Is there any equivalent control in .NET for the Power builder DataWindow control? I am explaining the Datawindow architecture to some extent. Power Builder DataWindow Control has got different...
6
by: Frank Rachel | last post by:
So I can focus on the correct areas of research, I was wondering if someone could give me the .NET equivelents for this J2EE architecture: JSP's make calls to local JavaBean Controls. The...
3
by: Marty | last post by:
Hi, What is the VB.NET equivalent of the VB6 ADODB.Connector and ADODB.Recordset? Thanks Marty
7
by: Tim Conner | last post by:
Hi, I am an ex-delphi programmer, and I having a real hard time with the following simple code (example ): Which is the equivalent to the following code ? var chars : PChar; sBack, s :...
10
by: karch | last post by:
How would this C# contruct be represented in C++/CLI? Or is it even possible? PolicyLevel level = (enumerator->Current) as PolicyLevel; Thanks, Karch
9
by: Alan Silver | last post by:
Hello, I'm converting some old VB6 code to use with ASP.NET and have come unstuck with the Asc() function. This was used in the old VB6 code to convert a character to its ASCII numeric...
14
by: grid | last post by:
Hi, I have a certain situation where a particular piece of code works on a particular compiler but fails on another proprietary compiler.It seems to have been fixed but I just want to confirm if...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.