-
January 19th, 2011, 08:50 PM
#1
Loading Content in same folder of exe
been working on getting a nice release of my program, it needs to read files from this directory
Code:
string homePath = (Environment.OSVersion.Platform == PlatformID.Unix ||
Environment.OSVersion.Platform == PlatformID.MacOSX)
? Environment.GetEnvironmentVariable("HOME")
: Environment.ExpandEnvironmentVariables("%HOMEDRIVE%%HOMEPATH%");
itemsContentPath = homePath + @"\My Documents\RPGProject\Content\Items";
really it only needs to read from files for THIS directory >> "RPGProject"
I want other people to use it but not have to worry about placing it \My Documents or not, since the exe is also in "RPGProject" is there a way to localize them so that no matter where RPGProject is, if exe and \Content\Items are there it should run just fine.
how do I make??
itemsContentPath = where ever I placed this @"\RPGProject\Content\Items";
-
January 20th, 2011, 11:10 AM
#2
Re: Loading Content in same folder of exe
Code:
using System.IO;
string exePath = Directory.GetParent(System.Reflection.Assembly.GetExecutingAssembly().Location));
-
January 20th, 2011, 01:32 PM
#3
Re: Loading Content in same folder of exe
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
|