|
![]() |
Overclock.net - Overclocking.net > Software, Programming and Coding > Coding and Programming > Application Programming | |
Visual Studio 2008 and Environment.CurrentDirectory
|
||
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 (permalink) | ||||||||||||
|
AMD Overclocker
![]() |
Warning: I have never, ever read a single tutorial or book on Visual Studio Express 2008.
However, I'm making a small application in it. ![]() In the process of making it a tad more user friendly I've decided to make it find out where it is located on its own. I'm trying to use this: Code:
Dim textFileStream As New IO.FileStream(Environment.CurrentDirectory & "\directory\blabla\tadah.txt", IO.FileMode.OpenOrCreate, IO.FileAccess.ReadWrite, IO.FileShare.None) http://weblogs.asp.net/joshclose/arc...udio-2008.aspx Porting the whole thing to VS2008 would be a real PITA at this point. If someone could explain what I should do in uber-simple steps it would be great
__________________
|
||||||||||||
|
|
|
|
|
#2 (permalink) | ||||||||||||
|
News Fiend
![]() |
http://msdn.microsoft.com/en-us/libr...ry(VS.71).aspx
__________________Directory.GetCurrentDirectory()
|
||||||||||||
|
|
|
|
|
#3 (permalink) | |||||||||||||
|
AMD Overclocker
![]() |
Quote:
__________________
|
|||||||||||||
|
|
|
|
|
#4 (permalink) | ||||||||||||
|
News Fiend
![]() |
It would help if you posted the code. As far as the error goes it means the directory does not exist.
__________________
|
||||||||||||
|
|
|
|
|
#5 (permalink) | |||||||||||||
|
Programmer
![]() |
Forgive if I'm wrong (I haven't written anything in VB since Visual Studio 6 was top of the line) but I thought VB already works in the directory it is executed in.
Unless I'm completely missing the point here. It's been a long day here at work ![]() EDIT: Try Code:
App.Path
__________________
Last edited by xtascox : 03-25-09 at 02:08 PM |
|||||||||||||
|
|
|
|
|
#6 (permalink) | |||||||||||||
|
AMD Overclocker
![]() |
Quote:
Edit: There's not much else to the code relevant to this, just Code:
Dim myFileWriter As New IO.StreamWriter(textFileStream)
__________________
|
|||||||||||||
|
|
|
|
|
#7 (permalink) | |||||||||||||
|
Programmer
![]() |
Did you try App.Path?
__________________
|
|||||||||||||
|
|
|
|
|
#8 (permalink) | ||||||||||||
|
AMD Overclocker
![]() |
It's not recognized properly, nor is AppPath for some reason.. =/
__________________
|
||||||||||||
|
|
|
|
|
#9 (permalink) | |||||||||||||
|
Programmer
![]() |
Check the properties and see if there is a working folder.
__________________
|
|||||||||||||
|
|
|
|
|
#10 (permalink) | ||||||||||||
|
AMD Overclocker
![]() |
There's none stated, but that would only work for my computer. If the installation is done somewhere else it wouldn't work, right?
Edit: Application.StartupPath has the same effect as above.
__________________
Last edited by MadCatMk2 : 03-25-09 at 02:40 PM |
||||||||||||
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|
|