任何人都可以帮助达到确切的路径

时间:2013-11-20 14:11:02

标签: c# windows-mobile

string timestamp = DateTime.Now.ToString("MM-dd-yyyy.HH-mm-ss");

 var file = File.Create("myfile.txt" + timestamp);

 var dir = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) +
 DateTime.UtcNow.ToString("yyyy/mm/dd") + @"\Owe-Data";

 if (!Directory.Exists(dir))

 {

         Directory.CreateDirectory(dir);

 }
 using (var sw = new StreamWriter(dir + file))
 {
     sw.WriteLine(InputData);
 }

}

但是在运行程序时会出错

System.Environment.SpecialFolder' does not contain a definition for 'CommonApplicationData'

也许这个文件夹不存在Windows手机可以有人建议如何获取Windows手机的路径

developing for windows phone, using visual studio 2008 .net framework 2.0

0 个答案:

没有答案