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

How do I get project folder in .NET?

How do I get project folder in .NET?
Nov 20 '05 #1
5 7704
* "astroboy" <da****@ddadde.com> scripsit:
How do I get project folder in .NET?


Are you referring to the application path?

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

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2
No not that I meant, I want to retrieve Project Folder or application path
location at compile time. If you go to Project-> xxx Properties->Common
Properties ->General
You would see Project folder, project file and output name in there, I would
like to get those infomation

Thx
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:c1*************@ID-208219.news.uni-berlin.de...
* "astroboy" <da****@ddadde.com> scripsit:
How do I get project folder in .NET?


Are you referring to the application path?

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

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

Nov 20 '05 #3
hum strange
what do you want to do with that info?
but here some code you can use
you have to dig in it, won't do exactly what you need, but it's already a
part of it
Imports EnvDTE 'add reference:
"C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\envd te.dll"

Public Class Class1

Public Shared Sub main()

Dim DTE As EnvDTE.DTE =
System.Runtime.InteropServices.Marshal.GetActiveOb ject("VisualStudio.DTE")
Dim vbProjects As Projects = DirectCast(DTE.GetObject("VBProjects"),
Projects)
Dim aProject As Project
For Each aProject In vbProjects
MsgBox(aProject.FullName)
Dim x As System.Collections.IEnumerator =
aProject.Properties.GetEnumerator()
Dim pr As [Property]
Dim msg As String = ""

While (x.MoveNext)
pr = DirectCast(x.Current, [Property])
msg &= pr.Name & vbCrLf

End While
MsgBox(msg)
Next
End Sub
End Class


"astroboy" <da****@ddadde.com> wrote in message
news:OC**************@TK2MSFTNGP10.phx.gbl...
No not that I meant, I want to retrieve Project Folder or application path
location at compile time. If you go to Project-> xxx Properties->Common
Properties ->General
You would see Project folder, project file and output name in there, I would like to get those infomation

Thx
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:c1*************@ID-208219.news.uni-berlin.de...
* "astroboy" <da****@ddadde.com> scripsit:
How do I get project folder in .NET?


Are you referring to the application path?

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

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


Nov 20 '05 #4
Cor
Hi Dominique,

Change the tittlebar of his project I think

:-)))

I really do not know otherwise I had answered you of course, but could not
resist this one.

Cor
Nov 20 '05 #5
well he was lucky, found that stuff while searching info to make my
windowtitle change
somewhere there is a MainWindow.Caption property which is the windowtitle of
visual studio

reading goes well but setting the property throws an exception
found some info where i read between the lines you can only read the caption
property for mainwindow
(for other windows it should work)

so i'm doomed i think

"Cor" <no*@non.com> wrote in message
news:er**************@tk2msftngp13.phx.gbl...
Hi Dominique,

Change the tittlebar of his project I think

:-)))

I really do not know otherwise I had answered you of course, but could not
resist this one.

Cor

Nov 20 '05 #6

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

Similar topics

5
by: David Webb | last post by:
The problem started when the Working Folder for a project was somehow set to the folder of another project. I set the correct working folder in VSS and deleted the .vbproj files that had been...
6
by: Vagif Abilov | last post by:
We decided to adopt .NET coding guidelines posted by Brad Abrams from Microsoft: http://blogs.msdn.com/brada/archive/2005/01/26/361369.aspx Here is what Brad (and AFAIK Microsoft) suggests...
8
by: Adam Clauss | last post by:
I have a folder containing many subfolders (and subfolders and....) all containing various .cs files. Is there any "easy" way to get them all added to the solution. Preferable would be that the...
4
by: Brad | last post by:
I'm not one to rant or flame....so please excuse me while I do so for this once. I've now spent a bit of time working with VS2005 beta 2 to see how it functions for web development, especially how...
8
by: vinesh | last post by:
I have sample Asp.Net Web Application project. Let me know how to keep the files related to this project (like the webform.aspx, WebForm1.aspx.vb, WebForm1.aspx.resx) in a separate folder within a...
1
by: Frank Rizzo | last post by:
Is there a way to create a web service project that has a proper project file (e.g. csproj), instead of having it be file based where whatever happens to be in the directory magically becomes part...
5
by: Richard J Foster | last post by:
Hi there, I have a pair of C# projects in VS2003. The first project, a dll, is referenced in the second via a project reference. The assemblies in question are delay-signed during a...
4
by: g4356 | last post by:
Hi, A new baby question: I downloaded a dot net project and saved it to my local disk. When I tried to open this project, a message popped up: "Unable to open web project "test/myfirstweb"/ The...
5
by: clintonb | last post by:
I'm a newbie when it comes to asp.net. All my prior experience is in making Windows applications in C++. In the past when I made windows applications, the project or target file would keep...
4
by: Alan Mailer | last post by:
Again, I'm new to VB.net and there is something I need help with: Like (I assume) many of us, over time I want to be able to create some VB.net classes that I might want to use in more than one...
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.