C# getting the path of %AppData%

后端 未结 10 2122
无人共我
无人共我 2020-11-22 13:50

C# 2008 SP1

I am using the code below:

dt.ReadXml(\"%AppData%\\\\DateLinks.xml\");

However, I am getting an exception that points t

10条回答
  •  悲哀的现实
    2020-11-22 14:39

    This is working for me in a console application -

    string appData = System.Environment.GetEnvironmentVariable("APPDATA");
    

提交回复
热议问题