Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the maximum http request length time?

In my asp.net/c# website, I make a request that takes like a minute, and sometimes it goes into an error saying the request timed out, and I can't catch it. But I thought of a work around.

I could get the maximum time as a value, then while doing the loop, I can time it, and if it goes past the max amount of time minus 4 seconds, then stop the loop.

But how can I get the maximum time (from web.config file)? Is there a variable I can use?

Thanks

like image 808
omega Avatar asked Nov 26 '25 19:11

omega


1 Answers

I do think you may check the HttpServerUtility.ScriptTimeout property - it reflects the web.config value for the executionTimeout attribute on httpRuntime element.

MSDN entry on this:

http://msdn.microsoft.com/en-us/library/system.web.httpserverutility.scripttimeout.aspx

Hope it helps!

like image 54
OnoSendai Avatar answered Nov 28 '25 07:11

OnoSendai



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!