xamarin.forms - 如何从指定位置读取文件并转换为 xamarin 形式的流
问题描述
我已尝试使用以下代码从该位置访问文件并将其转换为流
string filename = @"D:\ShapeFiles\usa_state.shp";
FileStream fs = new FileStream(filename, FileMode.Open, FileAccess.Read);
获取文件未找到异常,但该位置存在文件。
解决方案
//Get the file
var path = Path.Combine(FileSystem.CacheDirectory, "usa_state.shp");
var stream = File.OpenRead(path);
推荐阅读
- java - 文件名包含特殊字符的 Java Spring Boot 下载文件生成零字节下载文件
- opengl - Opengl:SSAO 与阴影映射
- excel - 仅查找并匹配 2 列中的前 5 个字符
- jenkins - 将地图字符串列表转换为地图列表作为groovy中的对象列表
- reactjs - 从对象 React Native 渲染
- android - 无法使用 @WorkerInject 在 WorkManager 中注入 @Binds Hilt 依赖项
- python - 如何绘制网格搜索布局和随机搜索布局
- java - 方法重载替代java
- ios - FCM 通知仅在应用打开时提供(iOS Flutter)
- kubernetes - 如何配置持久目录以在 kubernetes 中上传文件,以便可以从其他服务/pod 访问它