if(Session["login"]==null)
{
Response.Write("-1"); }
// 在此处放置用户代码以初始化页面
try
{
Response.ContentType = "text/plain";
Response.Charset = "utf-8"; HttpPostedFile file = Request.Files["Filedata"];
string uploadPath = HttpContext.Current.Server.MapPath(@Request["folder"]) +"\\";
// if(file.ContentLength)
if (file != null)
{
//if(file.ContentLength>10857600)
{
if (!Directory.Exists(uploadPath))
{
Directory.CreateDirectory(uploadPath);
}
string PathName=uploadPath+System.DateTime.Now.ToString("yyyMMddhhmmss") + Session.SessionID.ToString()+file.FileName;
file.SaveAs(PathName);
Session["path"]=PathName;
//下面这句代码缺少的话,上传成功后上传队列的显示不会自动消失
Response.Write("1");
}
}
else
{
Response.Write("0");
}我在客户端怎么获取Response.Write("-1")的值啊!请各位帮帮忙啊!
{
Response.Write("-1"); }
// 在此处放置用户代码以初始化页面
try
{
Response.ContentType = "text/plain";
Response.Charset = "utf-8"; HttpPostedFile file = Request.Files["Filedata"];
string uploadPath = HttpContext.Current.Server.MapPath(@Request["folder"]) +"\\";
// if(file.ContentLength)
if (file != null)
{
//if(file.ContentLength>10857600)
{
if (!Directory.Exists(uploadPath))
{
Directory.CreateDirectory(uploadPath);
}
string PathName=uploadPath+System.DateTime.Now.ToString("yyyMMddhhmmss") + Session.SessionID.ToString()+file.FileName;
file.SaveAs(PathName);
Session["path"]=PathName;
//下面这句代码缺少的话,上传成功后上传队列的显示不会自动消失
Response.Write("1");
}
}
else
{
Response.Write("0");
}我在客户端怎么获取Response.Write("-1")的值啊!请各位帮帮忙啊!
解决方案 »
- C#如何读取远程unix服务器文件夹下所有文件信息。谢谢
- winform,c#, 求datagridview导出到excel的代码
- 请高手看一段代码
- “占位程序接收到错误数据”的错误该怎么办?
- 请问VC结构体中包含指向另一个结构体的指针,在C#中该怎么定义?救命~~~
- 取服务端中dataGridView数据发送到客户端dataGridView中显示
- .NET Remoting 客户端激活模式,问题请教
- 有没有可能这样做?将richTextBox控件和一个VHSrcoll控件结合?
- 读取文件(TXT)
- 如何按照内容来设置RichTextBox和用户控件的高度?
- winform版的电子相册
- C#计算器,事件批量处理处理不了 请高手帮忙看下代码
{
if (Session["login"] == null)
{
Response.Write("-1");
Response.End();//可能是你想要的结果。 }
// 在此处放置用户代码以初始化页面
try
{
Response.ContentType = "text/plain";
Response.Charset = "utf-8"; HttpPostedFile file = Request.Files["Filedata"];
string uploadPath = HttpContext.Current.Server.MapPath(@Request["folder"]) + "\\";
// if(file.ContentLength)
if (file != null)
{
if (!Directory.Exists(uploadPath))
{
Directory.CreateDirectory(uploadPath);
}
string PathName = uploadPath + System.DateTime.Now.ToString("yyyMMddhhmmss") + Session.SessionID.ToString() + file.FileName;
file.SaveAs(PathName);
Session["path"] = PathName;
//下面这句代码缺少的话,上传成功后上传队列的显示不会自动消失
Response.Write("1");
}
else
{
Response.Write("0");
}
}
catch
{ }
}