|
-
Dec 15th, 2005, 02:23 PM
#1
[Resolved] .NET newbie has an easy question
Hello! Ive just switched from VB 6 to .Net and i feel like a complete stranger to VB at the moment
In VB6 u could write app.path to retrieve the apps path.. but what to write in .Net ? Cheers
Last edited by Atheist; Dec 16th, 2005 at 10:08 AM.
-
Dec 15th, 2005, 02:27 PM
#2
Frenzied Member
Re: .NET newbie has an easy question
-
Dec 15th, 2005, 02:28 PM
#3
Addicted Member
Re: .NET newbie has an easy question
-
Dec 15th, 2005, 02:31 PM
#4
Re: .NET newbie has an easy question
-
Dec 15th, 2005, 03:43 PM
#5
Re: .NET newbie has an easy question
If your thread is resolved, you can go to the top under "thread tools" and mark it as "resolved"
-
Dec 15th, 2005, 05:13 PM
#6
Re: .NET newbie has an easy question
If it's not resolved, you can throw a box of apple juice at gigemboy.
-
Dec 15th, 2005, 05:22 PM
#7
Re: .NET newbie has an easy question
mmm.. apple juice.... my favorite
-
Dec 15th, 2005, 06:40 PM
#8
Lively Member
Re: .NET newbie has an easy question
this wud also work and it is also sometimes better
VB Code:
Environment.CurrentDirectory
but the reason why it's better is becuase you can do stuff like
VB Code:
Environment.MachineName
Environment.OSVersion
Environment.UserName
and it get's better for stuff like desktop folder
VB Code:
Environment.SpecialFolder.Desktop()
Environment.SpecialFolder.Favorites()
Environment.SpecialFolder.MyComputer()
Environment.SpecialFolder.MyDocuments()
it's pretty cool and i would recomend it
-
Dec 15th, 2005, 06:58 PM
#9
Re: .NET newbie has an easy question
Environment.CurrentDirectory is almost always a BAD choice in this circumstance. Other applications can change the current directory.
Bill
-
Dec 15th, 2005, 08:11 PM
#10
Re: .NET newbie has an easy question
Yes sir, conipto is correct. Environment.Currentdirectory will not always return the application directory in ever instance. It is a windows system variable, and this can change depending on the other programs you have running as well. I was using Environment.Currentdirectory in some of my early programs and started getting errors when working with other programs as well, it would return some other directory that I had chosen in a file save dialog or what not in a different program. So, stick with application.startuppath...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|