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

how to get startupPath in console application

Ron
Hello,

I would like to retrieve the startupPath from a console
application. It appears that a console application does
not recognize Application, so I can't access StartupPath.
Is there a way to do this in a console application?

Thanks,
Ron
Nov 21 '05 #1
2 2318
"Ron" <an*******@discussions.microsoft.com> schrieb:
I would like to retrieve the startupPath from a console
application. It appears that a console application does
not recognize Application, so I can't access StartupPath.
Is there a way to do this in a console application?


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

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #2
Ron
Thanks. That was what I needed.
Ron
-----Original Message-----
"Ron" <an*******@discussions.microsoft.com> schrieb:
I would like to retrieve the startupPath from a console
application. It appears that a console application does not recognize Application, so I can't access StartupPath. Is there a way to do this in a console application?
\\\
Imports System.Reflection
..
..
..
Private Function ApplicationPath() As String
Return _
Path.GetDirectoryName([Assembly].GetEntryAssembly

().Location)End Function
///

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

Nov 21 '05 #3

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

Similar topics

5
by: z. f. | last post by:
i need to get the computer name from an aspx page. i use System.Windows.Forms.SystemInformation.ComputerName() and it's working fine, but in second thought, it might not be recomended to use the...
8
by: jcrouse | last post by:
I am trying to run a command from a command prompt using the shell command. Here is the syntax I want to execute: Shell(lblMameExePath.Text & " -listinfo >" & Application.StartupPath &...
4
by: kd | last post by:
Hi All, Is there an equivalent for Application.StartupPath in a console application? kd
1
by: Sean | last post by:
Hi I created a VB.NET console app. I try to use the Application.StartupPath() but got an error: Name 'Application' is not declared. Any idea? Thanks. Sean
2
by: moi | last post by:
Hello, Dim strConn As String = "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" & Application.StartupPath & "\app_data\aaaaaa.mdb;" Application.StartupPath does'nt work with ASP.NET 2 : ...
3
by: hayworth | last post by:
I had some code to build the name of a file: ' Build the name of the XML config file. g_strFiles.strConfig = My.Computer.FileSystem.CombinePath(Application.StartupPath, "\Settings\Config...
2
by: al jones | last post by:
There is no installation for the program I wrote, one just copies the files to some directory and runs it from there, I have both a working program and help file (.chm). From within the IDE...
5
getgagan
by: getgagan | last post by:
how to find Main folder where bin folder exists using application.startuppath in c# IF application.startuppath=D:\Test\ThreadExample\DnsLookup\DnsLookup\bin\Debug Then i need to find the...
0
by: =?Utf-8?B?U2hlbGRvbg==?= | last post by:
Hello - I am trying to access a Crystal Report. VS 2008 automatically creates the report in the same directory as the forms. When attempting to use Application.StartupPath, it takes me to the...
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: 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: 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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
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.