小编Sil*_*ght的帖子

超时已过期.操作完成之前经过的超时时间或服务器没有响应.该语句已终止

我的网站上有很多用户(每天20000-60000),这是一个移动文件的下载站点.我可以远程访问我的服务器(Windows Server 2008-R2).
我之前收到"服务器不可用"错误,但现在看到连接超时错误.
我不熟悉这个 - 它为什么会发生,我该如何解决?

完整错误如下:

'/'应用程序中的服务器错误.超时已过期.操作完成之前经过的超时时间或服务器没有响应.该语句已终止.描述:执行当前Web请求期间发生未处理的异常.请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息.

异常详细信息:System.Data.SqlClient.SqlException:超时已过期.操作完成之前经过的超时时间或服务器没有响应.该语句已终止.

来源错误:

在执行当前Web请求期间生成了未处理的异常.可以使用下面的异常堆栈跟踪来识别有关异常的起源和位置的信息.

堆栈跟踪:

[SqlException(0x80131904):超时已过期.操作完成之前经过的超时时间或服务器没有响应.语句已终止.]
System.Data.SqlClient.SqlConnection.OnError(SqlException异常,Boolean breakConnection
)+404
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()+ 412 System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior ,SqlCommand cmdHandler,SqlDataReader dataStream,BulkCopySimpleResultSet bulkCopyHandler,TdsParserStateObject stateObj)+1363
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds,RunBehavior runBehavior,String resetOptionsString)+6387741
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior,RunBehavior runBehavior,Boolean returnStream,Boolean async)+6389442
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior,RunBehavior runBehavior,Boolean returnStream,String method,DbAsyncResult result)+538
System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName,Boolean sendToPipe)+689
System.Data.SqlClient.SqlCommand.Execu teNonQuery()+ 327
NovinMedia.Data.DbObject.RunProcedure(String storedProcName,IDataParameter []参数,Int32和rowsAffected)+209
DataLayer.OnlineUsers.Update_SessionEnd_And_Online(Object Session_End,Boolean Online)+440
NiceFileExplorer.Global.Application_Start(Object sender,EventArgs e)+163

[HttpException(0x80004005):超时已过期.操作完成之前经过的超时时间或服务器没有响应.该语句已被终止.]
System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context,HttpApplication app)+405205​​3
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext,HttpContext context,MethodInfo [] handlers)+191
System.Web.HttpApplication. InitSpecial(HttpApplicationState状态,MethodInfo的[]处理程序,IntPtr的appContext,HttpContext的上下文)352
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr的appContext,HttpContext的上下文)407
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr的appContext)375

[HttpException(0x80004005):超时已过期.操作完成之前经过的超时时间或服务器没有响应.该语句已被终止.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context)+11686928 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context)+141 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr,HttpContext …

c# asp.net timeout sqlcommand sql-server-2008-r2

280
推荐指数
10
解决办法
71万
查看次数

如何从DateTime获取AM/PM值?

有问题的代码如下:

public static string ChangePersianDate(DateTime dateTime)
{
    System.Globalization.GregorianCalendar PC = new System.Globalization.GregorianCalendar();
    PC.CalendarType = System.Globalization.GregorianCalendarTypes.USEnglish;
    return
    PC.GetYear(dateTime).ToString()
    + "/"
    + PC.GetMonth(dateTime).ToString()
    + "/"
    + PC.GetDayOfMonth(dateTime).ToString()
    + ""
    + PC.GetHour(dateTime).ToString()
    + ":"
    + PC.GetMinute(dateTime).ToString()
    + ":"
    + PC.GetSecond(dateTime).ToString()
    + " "
    ????????????????
}
Run Code Online (Sandbox Code Playgroud)

如何从dateTime价值中获取AM/PM ?

.net c# datetime datetime-format gregorian-calendar

187
推荐指数
9
解决办法
29万
查看次数

如何将此foreach代码转换为Parallel.ForEach?

我有点困惑Parallel.ForEach.它究竟
是什么Parallel.ForEach以及它究竟做了什么?
请不要引用任何MSDN链接.

这是一个简单的例子:

string[] lines = File.ReadAllLines(txtProxyListPath.Text);
List<string> list_lines = new List<string>(lines);

foreach (string line in list_lines)
{
    //My Stuff
}
Run Code Online (Sandbox Code Playgroud)

我该如何重写这个例子Parallel.ForEach

c# multithreading .net-4.0 parallel.foreach

174
推荐指数
5
解决办法
22万
查看次数

什么是| =(单管道相等)和&=(单个&符号相等)的意思

在以下行中:

//Folder.Attributes = FileAttributes.Directory | FileAttributes.Hidden | FileAttributes.System | FileAttributes.ReadOnly;
Folder.Attributes |= FileAttributes.Directory | FileAttributes.Hidden | FileAttributes.System | FileAttributes.ReadOnly;


Folder.Attributes |= ~FileAttributes.System;
Folder.Attributes &= ~FileAttributes.System;
Run Code Online (Sandbox Code Playgroud)

在C#中,|=(单管道相等)和&=(单个&符号相等)是什么意思
我想删除系统属性并保留其他属性...

c# operators bitwise-operators

96
推荐指数
2
解决办法
7万
查看次数

如何在iis中因工作进程而100%防止CPU使用率

我使用自己的vps,vmware,quad core和4GB Ram的Windows Server 2008-R2中大部分时间的CPU使用率是100%.当我打开Windows任务管理器并转到资源监视器时,我发现100%的使用率是因为workerprocess.exe.我的IIS中有3个网站.

  • 我怎样才能找出导致该用途的网站
  • 如何将其限制为80%的CPU使用率?
  • 它可能是DDOS攻击吗?
  • 有没有办法防止DDOS?

我在我的vps上安装了eset-nod32,但它没有在日志中显示任何攻击.我已经尝试搜索IIS并阻止DDOS,并且刚刚找到了禁止IP地址的扩展,但我怎样才能找到生成流量的IP地址?

该网站是用ASP.NET和写的C#.如何确定该网站上发生的情况以及哪些代码行导致该cpu使用?

此外,我的一个网站应该访问管理员的桌面并读取和写入一些文件.因此,我将其应用程序池 - >身份(进程模型)更改为本地系统,我不知道它是否与CPU使用率相关.

asp.net worker-process cpu-usage iis-7.5 windows-server-2008-r2

54
推荐指数
2
解决办法
18万
查看次数

从物理路径获取相对虚拟路径

如何从asp.net中的物理路径获取相对虚拟路径?反向方法如下:

Server.MapPath("Virtual Path Here");
Run Code Online (Sandbox Code Playgroud)

但是上层方法的反转是什么?

c# asp.net path

39
推荐指数
4
解决办法
8万
查看次数

在设计时将NewLine添加到标签的文本中

我如何添加新行到LabelText在设计时?Stack Overflow上有一些关于如何在代码隐藏中执行此操作的帖子,但似乎没有关于设计时间的帖子,似乎?

c# label newline winforms windows-applications

34
推荐指数
3
解决办法
7万
查看次数

垂直和水平对齐(中间和中间)与css

我正在练习CSS,我很困惑,我怎么能强迫我的div元素在我的页面中心(垂直和水平)(意味着跨浏览器兼容性的方式或方式)?

最好的祝福 !

css xhtml alignment

28
推荐指数
1
解决办法
12万
查看次数

请求失败,HTTP状态为417:期望失败 - 使用Web服务

几分钟前,我正在开发visual studio 2010中的一个项目,突然我的电脑重新启动了.
重新启动后,我在本地机器上浏览该网站时收到以下错误:

请求失败,HTTP状态为417:期望失败.

描述:执行当前Web请求期间发生未处理的异常.请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息.

异常详细信息:System.Net.WebException:请求失败,HTTP状态为417:期望失败.

我的网站名称是:MyWebSite
我在远程服务器(vps)上有一个Web服务,MyWebSite正在使用它并且该错误与它有关系.

Line 172:        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/MyWebSiteEnable", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
Line 173:        public bool MyWebSiteEnable() {
Line 174:            object[] results = this.Invoke("MyWebSiteEnable", new object[0]);
Line 175:            return ((bool)(results[0]));
Line 176:        }
Run Code Online (Sandbox Code Playgroud)

关于那个Web服务,每件事情都可以.
这是什么错误,我该如何解决?
在该Web服务中只有一个简单的bool方法,它返回true.
我在代码隐藏中使用该web服务,如下所示:

private void CheckForPageExpiration()
{
    MyService service = new MyService();
    if (service.MyWebSiteEnable())
    {
    }
    else
    {
        Response.Redirect("~/blank.aspx");
    }
}
Run Code Online (Sandbox Code Playgroud)

我删除了该Web服务并再次添加,但仍然有错误!
这有什么不对?

提前致谢

c# asp.net web-services exception

22
推荐指数
1
解决办法
3万
查看次数

html电子邮件中的背景图像css - Gmail不支持

我想发送html正文电子邮件,如下面的background-image css给我的用户:

<div style='width:500px;height:1000px;background-color:black;background-image:url(http://upl0ad.org/images/mylogo.gif) repeat scroll left top;'>
    My Content
</div>
Run Code Online (Sandbox Code Playgroud)

但正如下面的链接说谷歌不支持背景图像CSS!
http://www.campaignmonitor.com/css/

我该怎么办?

html css email

21
推荐指数
2
解决办法
7万
查看次数