using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnUpload_Click(object sender, EventArgs e)
{
HttpFileCollection fileColl = Request.Files; //获取当前请求中所有的文件信息
DataClass dc = new DataClass();
bool bResult = false; //判断保存是否成功
try
{
bResult = dc.SaveFilesInfo(fileColl);
}
catch (Exception ex){}
if(bResult)
{
Response.Write("<script>alert('文件保存成功!')</script>");
}
else
{
Response.Write("<script>alert('文件保存失败!')</script>");
}
}
}
单看这段,逻辑上是对的,但是正确执行与否需要你设置断点调试。
dc.SaveFilesInfo在哪里实现的
客户端怎么写的。
你的程序运行下发现什么问题。