0
如何限制使用不asp.netASP.NET數限制下載
如何限制使用不asp.netASP.NET數限制下載
一種選擇喜歡的網站RAPIDSHARE或互聯星空下載次數:跟蹤IP地址
你可以使用一個Semaphore,以防止它。它將如下所示:
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(); }