File.OpenRead()中文路径出错
程序运行到FileStream fs = File.OpenRead(filePath);时出错,filePath为中文路径。
出错信息:
请问怎样用FileStream读取中文路径的文件?
出错信息:
A first chance exception of type 'System.UnauthorizedAccessException' occurred in mscorlib.dll
Step into: Stepping over method without symbols 'System.Web.UI.Page.ProcessRequestMain'
A first chance exception of type 'System.Web.HttpUnhandledException' occurred in System.Web.dll
Step into: Stepping over method without symbols 'System.Web.UI.Page.ProcessRequest'
A first chance exception of type 'System.Web.HttpUnhandledException' occurred in System.Web.dll
Step into: Stepping over method without symbols 'System.Web.UI.Page.ProcessRequest'
Step into: Stepping over method without symbols 'System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute'
Step into: Stepping over method without symbols 'System.Web.HttpApplication.ExecuteStep'
Step into: Stepping over method without symbols 'System.Web.HttpApplication.PipelineStepManager.ResumeSteps'
Step into: Stepping over method without symbols 'System.Web.HttpApplication.BeginProcessRequestNotification'
Step into: Stepping over method without symbols 'System.Web.HttpRuntime.ProcessRequestNotificationPrivate'
Step into: Stepping over method without symbols 'System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper'
Step into: Stepping over method without symbols 'System.Web.Hosting.PipelineRuntime.ProcessRequestNotification'
Step into: Stepping over method without symbols 'System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper'
Step into: Stepping over method without symbols 'System.Web.Hosting.PipelineRuntime.ProcessRequestNotification'
A first chance exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll请问怎样用FileStream读取中文路径的文件?
...全文
相关推荐
浅谈python 调用open()打开文件时路径出错的原因
主要介绍了浅谈python 调用open()打开文件时路径出错的原因,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧
PHP中file_exists()判断中文文件名无效的解决方法
本文实例讲述了PHP中file_exists()判断中文文件名无效的解决方法。分享给大家供大家参考。具体方法如下: php中判断文件是否存在我们会使用file_exists函数或is_file函数,但在使用file_exists时如果你文件名或路径是中文在uft8编码文档时是无效。本文就来解决此问题,下面我们一起来看看。 定义和用法: file_exists() 函数检查文件或目录是否存在。 如果指定的文件或目录存在则返回 true,否则返回 false。 例子1 复制代码 代码如下:<?php echo file_exists(“test.txt”); ?> 输出: 1 例子2 复制代码 代
java中File的相对路径与绝对路径总结
java web中File的相对路径与绝对路径总结,用于在运行时获取配置文件、动态加载对象等
Java 解决中文路径问题
NULL 博文链接:https://snailzhang-126-com.iteye.com/blog/512442
android实现Uri获取真实路径转换成File的方法
主要介绍了android实现Uri获取真实路径转换成File的方法,涉及Android操作路径的相关技巧,需要的朋友可以参考下


