我在Assets文件夹中有data.xlsx
文件,需要获取它的路径来应用一些库。如何在Xamarin中获取资产文件路径?
在这里找到了几个解决方案,但都不适合我。例如 - File Not Found Exception In Xamarin program
我试过使用file:///android_asset/data.xlsx
但这里没有文件。
我检查的路径:System.IO.File.Exists(filePath);
那么如何获得此文件路径?也许我必须把它放在不同的文件夹中?
更新:可能我可以解决这样说:java.io.FileNotFoundException: This file can not be opened as a file descriptor; it is probably compressed
但我找不到在哪里把它。
更新:这个问题是关于Java,这是目前还不清楚如何使用Xamarin.Android此解决方案:How to get the android Path string to a file on Assets folder?
尝试使用* file://android_asset/data.xlsx *而不是* file:///android_asset/data.xlsx * –
@MiladYarmohammadi,结果相同。 – InfernumDeus
请参阅http://stackoverflow.com/questions/8474821/how-to-get-the-android-path-string-to-a-file-on-assets-folder –