急,高分求助! 急,高分求助!我的網站中有一個葉面在response.redirect("aa.aspx")事件時候,出現“The following error was encountered: Read Error (104) Connection reset by peer”請大蝦們幫忙! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 经常出现的Connection reset by peer: 原因可能是多方面的,不过更常见的原因是:①:服务器的并发连接数超过了其承载量,服务器会将其中一些连接Down掉;②:客户关掉了浏览器,而服务器还在给客户端发送数据;③:浏览器端按了Stop 执行response.redirect("aa.aspx")语句的页面中的Connection是否已经关闭? 是有防火墙,但是这个网站的其它叶面都可以访问,现在发现点这个叶面中的任何一个按钮都报这个错。叶面初始化的时候的代码private void Page_Load(object sender, System.EventArgs e) { // 在这里放置使用者程序代码以初始化网页 if(!IsPostBack) { if(Session["userid"] ==null) { Response.Redirect("../login.aspx"); } else { getbu(); ecoam.Clear(); boxlistm.Clear(); digitm.Clear(); hif.Clear(); arr.Clear(); i=0; // jy(); // Move("D:\\CC","D:\\files"); } } else { if (ECOAAttachFile.Value!="") { ecoam.Add(ECOAAttachFile); ECOAAttachFile=((System.Web.UI.HtmlControls.HtmlInputFile)ecoam[0]); this.TextBox1.Text=((System.Web.UI.HtmlControls.HtmlInputFile)ecoam[0]).Value; this.TextBox1.Visible=true; ButtonECOA.Visible =true; ECOAAttachFile.Visible =false; } //** if (BoxingListAttachFile.Value!="") { boxlistm.Add(BoxingListAttachFile); BoxingListAttachFile=((System.Web.UI.HtmlControls.HtmlInputFile)boxlistm[0]); this.TextBoxBox.Text=((System.Web.UI.HtmlControls.HtmlInputFile)boxlistm[0]).Value; this.TextBoxBox.Visible=true; this.BoxingListAttachFile.Visible =false; this.ButtonBOX.Visible =true; } //*** if (DigitalPackingListFile.Value!="") { digitm.Add(DigitalPackingListFile); DigitalPackingListFile=((System.Web.UI.HtmlControls.HtmlInputFile)digitm[0]); this.TextBoxDIGIT.Text=((System.Web.UI.HtmlControls.HtmlInputFile)digitm[0]).Value; this.TextBoxDIGIT.Visible=true; this.DigitalPackingListFile.Visible =false; this.ButtonDIGIT.Visible =true; } } } 问题解决了,我把页面上的filefiled上传控件删除再重新建立一个就好了,这个是.net的bug问题! private DataTable GetData() { string constr = "server=INLLHBI01;database=INNOLUX;uid=biadm;pwd=bidwh;"; SqlConnection myConn = new SqlConnection(constr); myConn.Open(); string cmdstr = ""; string subCmdstr=""; subCmdstr += " select sizeid,versionid,B.gradeid,sum(Qty) qty "; subCmdstr += " from innolux.dbo.fact_pipeline a left join innolux.dbo.Dim_PipeLine_Grade b on a.inlpnid=b.innoluxpn "; subCmdstr += " where STATIONID='MOD BU' and convert(float,left(sizeid,CHARINDEX('\"',SIZEID)-1))>=14.1 "; subCmdstr += " group by sizeid,versionid,B.gradeid "; cmdstr += subCmdstr; cmdstr += " union "; cmdstr += " select sizeid,'zsubtotal' as versionid,'zsubtotal' as gradeid,sum(qty) qty " ; cmdstr += " from "; cmdstr += " ( "; cmdstr += subCmdstr; cmdstr += " ) t "; cmdstr += " group by sizeid "; cmdstr += " union "; cmdstr += " select 'ztotal' sizeid,'ztotal' versionid,'ztotal' gradeid,sum(qty) qty "; cmdstr += " from "; cmdstr += " ( "; cmdstr += subCmdstr; cmdstr +=" ) t "; SqlDataAdapter da = new SqlDataAdapter(cmdstr,myConn); DataTable dt = new DataTable(); da.Fill(dt); myConn.Close(); myConn.Dispose(); return dt; } #endregion //從起動后到第一次執行的時間 public override long GetDueTime() { // return timeTo("05:00:00"); return 1000; } private long timeTo(string exeTime) { DateTime now = DateTime.Now; DateTime exeDateTime = DateTime.Parse(now.Date.ToString("yyyy/MM/dd") + " " + exeTime); if(exeDateTime < now) { exeDateTime = exeDateTime.AddDays(1); } TimeSpan ts = exeDateTime.Subtract(now); long totalMilliseconds = ts.Days * 86400000 + ts.Hours * 3600000 + ts.Minutes * 60000 + ts.Seconds * 1000 + ts.Milliseconds; return totalMilliseconds; } //時隔多久執行下一次 public override long GetPeriod() { // return 60000; return 86400000; } }} C#中,如何将多行文本框中的内容保存入已有内容的txt文件? 求救C#读取sybase数据库是乱码 串口数据解析问题 窗体程序中form1的属性size的长度为什么不能设置小于123呢? 如何在C#里将操作IIS,将一个WEB站点创建成WEB应用程序(超难高分) 关于网络爬虫 100分,求教线程,弹出对话框的解决办法 2005部署问题,如何将框架部署到windows应用程序中? C#中重画菜单的问题,达到XP开始菜单的效果,请会的帮忙! WEB页面中,关闭当前页面时,如何关闭已打开的线程?如何控制页面的关闭呢? 刷新用户控件 在tabPage中显示Form的问题,请看看,给分。
叶面初始化的时候的代码
private void Page_Load(object sender, System.EventArgs e)
{
// 在这里放置使用者程序代码以初始化网页
if(!IsPostBack)
{
if(Session["userid"] ==null)
{
Response.Redirect("../login.aspx");
}
else
{
getbu();
ecoam.Clear();
boxlistm.Clear();
digitm.Clear();
hif.Clear();
arr.Clear();
i=0;
// jy();
// Move("D:\\CC","D:\\files");
}
}
else
{
if (ECOAAttachFile.Value!="")
{ ecoam.Add(ECOAAttachFile);
ECOAAttachFile=((System.Web.UI.HtmlControls.HtmlInputFile)ecoam[0]);
this.TextBox1.Text=((System.Web.UI.HtmlControls.HtmlInputFile)ecoam[0]).Value;
this.TextBox1.Visible=true;
ButtonECOA.Visible =true;
ECOAAttachFile.Visible =false;
}
//**
if (BoxingListAttachFile.Value!="")
{
boxlistm.Add(BoxingListAttachFile);
BoxingListAttachFile=((System.Web.UI.HtmlControls.HtmlInputFile)boxlistm[0]);
this.TextBoxBox.Text=((System.Web.UI.HtmlControls.HtmlInputFile)boxlistm[0]).Value;
this.TextBoxBox.Visible=true;
this.BoxingListAttachFile.Visible =false;
this.ButtonBOX.Visible =true;
}
//***
if (DigitalPackingListFile.Value!="")
{ digitm.Add(DigitalPackingListFile);
DigitalPackingListFile=((System.Web.UI.HtmlControls.HtmlInputFile)digitm[0]);
this.TextBoxDIGIT.Text=((System.Web.UI.HtmlControls.HtmlInputFile)digitm[0]).Value;
this.TextBoxDIGIT.Visible=true;
this.DigitalPackingListFile.Visible =false;
this.ButtonDIGIT.Visible =true;
}
} }
{
string constr = "server=INLLHBI01;database=INNOLUX;uid=biadm;pwd=bidwh;";
SqlConnection myConn = new SqlConnection(constr); myConn.Open(); string cmdstr = "";
string subCmdstr=""; subCmdstr += " select sizeid,versionid,B.gradeid,sum(Qty) qty ";
subCmdstr += " from innolux.dbo.fact_pipeline a left join innolux.dbo.Dim_PipeLine_Grade b on a.inlpnid=b.innoluxpn ";
subCmdstr += " where STATIONID='MOD BU' and convert(float,left(sizeid,CHARINDEX('\"',SIZEID)-1))>=14.1 ";
subCmdstr += " group by sizeid,versionid,B.gradeid "; cmdstr += subCmdstr;
cmdstr += " union ";
cmdstr += " select sizeid,'zsubtotal' as versionid,'zsubtotal' as gradeid,sum(qty) qty " ;
cmdstr += " from ";
cmdstr += " ( ";
cmdstr += subCmdstr;
cmdstr += " ) t ";
cmdstr += " group by sizeid ";
cmdstr += " union ";
cmdstr += " select 'ztotal' sizeid,'ztotal' versionid,'ztotal' gradeid,sum(qty) qty ";
cmdstr += " from ";
cmdstr += " ( ";
cmdstr += subCmdstr;
cmdstr +=" ) t ";
SqlDataAdapter da = new SqlDataAdapter(cmdstr,myConn);
DataTable dt = new DataTable();
da.Fill(dt); myConn.Close();
myConn.Dispose(); return dt;
}
#endregion
//從起動后到第一次執行的時間
public override long GetDueTime()
{
// return timeTo("05:00:00");
return 1000;
}
private long timeTo(string exeTime)
{
DateTime now = DateTime.Now;
DateTime exeDateTime = DateTime.Parse(now.Date.ToString("yyyy/MM/dd") + " " + exeTime);
if(exeDateTime < now)
{
exeDateTime = exeDateTime.AddDays(1);
}
TimeSpan ts = exeDateTime.Subtract(now);
long totalMilliseconds = ts.Days * 86400000 + ts.Hours * 3600000 + ts.Minutes * 60000 + ts.Seconds * 1000 + ts.Milliseconds;
return totalMilliseconds;
} //時隔多久執行下一次
public override long GetPeriod()
{
// return 60000;
return 86400000;
} }
}