zoukankan      html  css  js  c++  java
  • 如何设置ASP.NET页面的运行超时时间

    全局超时时间

    服务器上如果有多个网站,希望统一设置一下超时时间,则需要设置 Machine.config 文件中的 ExecutionTimeout 属性值。
    Machine.config 文件位于 %SystemRoot%Microsoft.NETFramework\%VersionNumber%CONFIG 目录中。
    例如:

    1
    <httpRuntime executionTimeout="90" maxRequestLength="4096" useFullyQualifiedRedirectUrl="false" minFreeThreads="8" minLocalRequestFreeThreads="4" appRequestQueueLimit="100" />

    单个站点超时时间
    Web.config配置文件中设置http请求运行时间:

    1
    2
    3
    <system.web>
    <httpRuntime maxRequestLength="102400" executionTimeout="720" />
    </system.web>


    这里设置的为720秒,前面的属性maxRequestLength一般用于用户上传文件限制大小!默认一般为4096 KB (4 MB)。

    单个页面请求超时时间
    对于单个页面,可以使用Server.ScriptTimeout来设定超时。

    1
    Server.ScriptTimeout = 120;

     

    注意:如果在Web.config里设置了debug属性,例如:<compilation debug="true" targetFramework="4.0">
    此时,ScriptTimeout会被忽略。

  • 相关阅读:
    打包压缩文件命令
    用户与组管理命令
    cut 命令 通过列来提取文本字符
    linux文件拼接命令 paste
    shell 指定范围产生随机数
    shell 脚本随机抽取班级学生
    shell 输出九九乘法表
    shell 判断语句
    linux 排序命令sort
    linux之PATH环境变量
  • 原文地址:https://www.cnblogs.com/Jeremy2001/p/6270741.html
Copyright © 2011-2022 走看看