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