, - , - ?
- , - . , :
file not found 'C:\Users\eli\AppData\Roaming\fourmlinks.txt'
""; , .
,
? , , . " ...", , .
string path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "fourmlinks.txt");
, . "fourmlinks.txt" , - , , , .
string path = Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location),
"fourmlinks.txt");
. - , , - . - , .
, GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location)? , . GetExecutingAssembly().Location , , . , , . , .
, , Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData). , , . System.Reflection.Assembly.GetExecutingAssembly().Location. - :
string fileName = "fourmlinks.txt";
string target = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), fileName);
if (!File.Exists(target))
{
string source = Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), fileName);
File.Copy(source, target);
}
GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) , ; , .
, , , Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData).