[英]ASP.NET Limit number download
如何使用asp.net限制Rapidshare或Megaupload站点之类的下载数量
一种选择:跟踪IP地址
You could use a Semaphore to prevent it. 您可以使用信号量来防止它。 It would be something like the following: 它将类似于以下内容:
Semaphore sem = new Semaphore(0, 5, "<Client IP Address, or Session/Auth Cookie>"); if( !sem.WaitOne(0) ) throw new Exception(); try { ... write download ... } finally { sem.Release(); }
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.