i am making a load script and the game is in a place where it can not right to and i want it to right to the %AppData% variable but it will not let me,`Readfile("%AppData%"+"/gamethang/save.txt"); function Readfile(read:String) { var sr = new StreamReader(read); reads=sr.ReadLine(); }` if there is no way for you to with appdata is there any way with %SystemDrive% or something similar where it can tell which drive is there main one also i am using js and it is not webplayer
1 Answer
1You can find the appdata folder with this code:
```
System.Environment.GetFolderPath(System.Environment.SpecialFolder.ApplicationData)
This will return a string like "C:\Documents and Settings\Administrator\Application Data". A little example code of how you can use this:
var appdata : String;
appdata =System.Environment.GetFolderPath(System.Environment.SpecialFolder.ApplicationData);
var data = System.IO.File.ReadAllText(appdata+"/myunitygame/saves/file1.save");
```