473,216 Members | 1,363 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,216 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 7683
* "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...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...

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.