请帮我看看,上传文件哪里出错了!
不知道为什么,不能上传文件,源文件如下:
private void Button1_Click(object sender, System.EventArgs e)
{
HttpFileCollection MyFileCollection = Request.Files;
string path = Server.MapPath("./");
MyFileCollection[0].SaveAs(path);
}
错误信息如下:
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index
Source Error:
Line 53: string path = Server.MapPath("./");
Line 54: MyFileCollection[0].SaveAs(path);
Line 55: }
Line 56: }
Source File: c:\inetpub\wwwroot\webapplication1\webform1.aspx.cs Line: 54
private void Button1_Click(object sender, System.EventArgs e)
{
HttpFileCollection MyFileCollection = Request.Files;
string path = Server.MapPath("./");
MyFileCollection[0].SaveAs(path);
}
错误信息如下:
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index
Source Error:
Line 53: string path = Server.MapPath("./");
Line 54: MyFileCollection[0].SaveAs(path);
Line 55: }
Line 56: }
Source File: c:\inetpub\wwwroot\webapplication1\webform1.aspx.cs Line: 54
...全文
相关推荐
spring boot上传文件出错问题如何解决
主要介绍了spring boot上传文件出错问题如何解决,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下
上传IPA出现的错误提示“application loader“上传出错解决方法
主要介绍了上传IPA出现的错误提示“application loader“上传出错解决方法的相关资料,需要的朋友可以参考下
golang大文件上传
go大文件上传的example
maven打包出错解决办法,亲测绝对可以!
自己整理的maven打包出现错误的解决办法、含有截图等 附带maven搭建私服等资料
【Mode】Edge coupler design
更改完成 Script 中的内容后,重新进行官网给出的操作,运行后可以得到如下图像,这里的 group_span_2 实际表示的是 taper 的长度表示当 taper 的长度大约为 1500 um 时,我们能够得到最大的透射率。本文,我们将使用官方提供的 Edge coupler 设计教程,但是中间会带有作者本人的设计的感悟。中的显示如上图所示,这样我们进行上述操作步骤就可以获取到正确的结果了。光纤模斑的时候一切都是正常的,但是当我们后面启用。查看两个模式的匹配度,最终获取到的匹配度为。


