C# 解决Get请求数据量过大时被拒绝访问

一: 在程序的web.config 中system.web 节点 里面插入
<httpRuntime maxRequestLength="999999999" maxQueryStringLength="2097151" />
二:在程序的web.config 中sconfiguration 节点 里面插入
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="2147483647" maxQueryString="2147483647"/>
</requestFiltering>
</security>
</system.webServer>

这里主要是通过配置WebConfig,来提高程序的接受数据量大小。

如果不严谨可以将Get请求转为POST请求也可以解决。

原文地址:https://www.cnblogs.com/namelessblog/p/14122176.html