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

How can I tell my app where it's executed from?

I have an app where the first thing a user must do is load a specific
type of file. I have provided a demo copy of this file with the app
and stored it in the install directory - but I don't know where the
user will install the app. How can I get the path to the install
directory at run time?

Thanks in advance,
Ted

Jun 25 '07 #1
2 1061
The following gives you the directory where the exe loads from.

System.AppDomain.CurrentDomain.BaseDirectory

Jayme
"T Driver" <dr******@gmail.comwrote in message
news:11**********************@u2g2000hsc.googlegro ups.com...
>I have an app where the first thing a user must do is load a specific
type of file. I have provided a demo copy of this file with the app
and stored it in the install directory - but I don't know where the
user will install the app. How can I get the path to the install
directory at run time?

Thanks in advance,
Ted
Jun 25 '07 #2
On Jun 25, 4:44 pm, "Jayme.Pechan" <j...@pechan.uswrote:
The following gives you the directory where the exe loads from.

System.AppDomain.CurrentDomain.BaseDirectory

Jayme

"T Driver" <drive...@gmail.comwrote in message

news:11**********************@u2g2000hsc.googlegro ups.com...
I have an app where the first thing a user must do is load a specific
type of file. I have provided a demo copy of this file with the app
and stored it in the install directory - but I don't know where the
user will install the app. How can I get the path to the install
directory at run time?
Thanks in advance,
Ted
Brilliant! works like a champ - thanks much!
Ted

Jun 26 '07 #3

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

Similar topics

5
by: Krisnamourt Correia via SQLMonster.com | last post by:
I have one query that executes many times in a week. I created one Maintenances plan that Rebuild all index in my Database that has been executed at 23:40 Saturday until stop finished at Sunday. ...
5
by: Franco, Gustavo | last post by:
Hi, I have a question, and please I need a answer. How can I finalize a thread running with Application.Run (I need the message loop!!!) without call Thread.Abort?. I want to call...
3
by: SSonnenwald | last post by:
I have created a piece of code that uses a ThreadPool class and the QueueUserWorkItem method to add items to the the ThreadPool. What would seem to be simple I just can not figure out how to tell...
6
by: Marty | last post by:
Is there a property or method to tell you if you are running in the IDE or as a compiled exe? Thanks.
3
by: Tales Normando | last post by:
Hi, I'm working on a cybercafe management system that uses a homemade messaging exchange system to communicate between the server and the client softwares. Each one of the projects spawns...
7
by: Don | last post by:
Is there any way to check, in code, whether that code is being executed because of a compile as opposed to being executed because someone is just running the program? - Don
3
by: ericw3 | last post by:
I am testing the code snippets of John Peterson ( http://www.asp101.com/articles/john/codebehindnovs/default.asp ). I have WebForm2.vb as follows: Public Class WebForm2 Inherits...
5
by: garyusenet | last post by:
I understand that Point is an object used for storing co-ordinates, such as mouse location. I can't figure out what the e's do in the above example can someone explain please. Thanks, Gary.
3
by: jesper_lofgren | last post by:
Hello, I have a problem, i have a event in asp.net codebehind file that updating a datasource. If that update went well i want to refresh my treeview thats on another page. The script works...
5
by: Shalini Bhalla | last post by:
hi , A strange error is coming , when i run a php file , all the php and java script executes before submit only which actually should execute after clicking on submit button and...
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: 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: 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
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.