当我尝试从本地系统上传一个视频文件时,出现以下错误 [英] when iam trying to upload one vedio file from local system i am getting the following error

查看:75
本文介绍了当我尝试从本地系统上传一个视频文件时,出现以下错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用文件上传控件



文件不支持uploadSystem.IO.FileNotFoundException:找不到文件"C:\ Program Files \ Microsoft Visual Studio 9.0 \ Common7 \ IDE \ New Stories(Highway Blues).wma".文件名:System.IO处的``C:\ Program Files \ Microsoft Visual Studio 9.0 \ Common7 \ IDE \ New Stories(Highway Blues).wma''.System.IO中的__Error.WinIOError(Int32 errorCode,String mayFullPath). FileStream.Init(字符串路径,FileMode模式,FileAccess访问权限,Int32权限,布尔值useRights,FileShare共享,Int32 bufferSize,FileOptions选项,SECURITY_ATTRIBUTES secAttrs,字符串msgPath,布尔值bFromProxy)在System.IO.FileStream..ctor(字符串路径,在d:\ 179 GlobalIndactinationSignaturesystem \ GlobalIndactinationSignaturesystem \ UserControls \ BrowseFile.ascx.cs:line 65

i am using file upload control



File Not Supporting to uploadSystem.IO.FileNotFoundException: Could not find file ''C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\New Stories (Highway Blues).wma''. File name: ''C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\New Stories (Highway Blues).wma'' at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access) at BrowseImage.UIUtilities.ReadFile(String PostedFileName, String[] filetype) in d:\179 GlobalIndactinationSignaturesystem\GlobalIndactinationSignaturesystem\UserControls\BrowseFile.ascx.cs:line 65

推荐答案

"C:\ Program Files \ Microsoft Visual Studio 9.0 \ Common7 \ IDE \ New Stories(Highway Blues).wma"听起来像是您在使用相对路径("New Stories(Highway Blues).wma" )(在Visual Studio的上下文中)(将工作目录设置为C:\ ... Commen7 \ IDE \).

您应该通过完整的路径.
您可以使用
"C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\New Stories (Highway Blues).wma" sounds as you are using relative paths ("New Stories (Highway Blues).wma") in the context of Visual Studio (which sets the working directory to C:\...Commen7\IDE\).

You should pass the full path.
You can use
string path = System.IO.Path.GetDirectoryName(
   System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase );


获取应用程序目录的目录路径.


to obtain the directory path to the directory of your application.

File.Open(path + "\\New Stories (Highway Blues).wma");


应该可以.


should work then.


这篇关于当我尝试从本地系统上传一个视频文件时,出现以下错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆