有人知道如何在Xamarin中获取iOS 8的tmp
目录路径吗?
只需尝试:
var documents = NSFileManager.DefaultManager
.GetUrls(NSSearchPathDirectory.DocumentDirectory, NSSearchPathDomain.User)[0].Path;
var tmp = Path.Combine(documents, "../", "tmp");
tmp
目录是真正的目录还是Documents
目录的子目录(可以通过iTunes文件共享提供给用户,并且会被备份)? - testing/Documents/../tmp/test.jpg
。通过 ..
,他成功进入正确的路径。 - testingvar tmp = System.IO.Path.GetTempPath ();
//https://developer.xamarin.com/guides/ios/application_fundamentals/working_with_the_file_system
public string TempPath()
{
var documents = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
var ret = Path.Combine(documents, "..", "tmp");
return ret;
}
var caches = Path.Combine (NSFileManager.DefaultManager.GetUrls(NSSearchPathDirectory.LibraryDirectory, NSSearchPathDomain.User) [0].Path, "Caches");
这样的东西? - testing