Kru*_*lur 10 c# xamarin.ios ios xamarin
这将使我的iOS应用程序的文档根目录:
Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)
Run Code Online (Sandbox Code Playgroud)
是否有类似的东西进入Library文件夹?
Cin*_*Bun 15
var docsPath = Environment.GetFolderPath (Environment.SpecialFolder.MyDocuments);
var libPath = Path.Combine (docsPath, "..", "Library");
Run Code Online (Sandbox Code Playgroud)
当前(iOS 12),您可以通过以下方式检索库路径:
var libraryPath = GetFolderPath(SpecialFolder.Resources);
".../APP-UUID/Library"
Run Code Online (Sandbox Code Playgroud)
对于嵌套在Library文件夹中的目录,例如本地应用程序缓存,可以执行以下操作:
var pathToCache = Path.Combine(libraryPath, "Caches");
".../APP-UUID/Library/Caches"
Run Code Online (Sandbox Code Playgroud)
Xamarin IOS上可能感兴趣的其他目录:
SpecialFolder.Favorites = ".../APP-UUID/Library/Favorites"
SpecialFolder.MyDocuments = ".../APP-UUID/Documents"
SpecialFolder.MyMusic = ".../APP-UUID/Documents/Music"
SpecialFolder.MyPictures = ".../APP-UUID/Documents/Pictures"
SpecialFolder.MyVideos = ".../APP-UUID/Documents/Videos"
SpecialFolder.Desktop = ".../APP-UUID/Documents/Desktop"
Run Code Online (Sandbox Code Playgroud)
可以在Xamarin文件系统文档中探索更多选项
在iOS8中,我使用了它并且它有效:
NSFileManager.DefaultManager.GetUrls (NSSearchPathDirectory.LibraryDirectory, NSSearchPathDomain.User) [0].Path
Run Code Online (Sandbox Code Playgroud)
我是从Xamarin 关于iOS文件系统的页面得到的.它说"iOS 8注意:本文档的部分内容受iOS 8中的更改影响.如果您的应用程序使用Environment.SpecialFolder或计算相对路径,如"../Documents",您应该阅读Apple的此技术说明.更新的信息也是可在iOS文件系统基础版上找到."
归档时间: |
|
查看次数: |
6844 次 |
最近记录: |