http://pastebin.com/aK0zcxMN ( http://dotnetslackers.com/articles/aspnet/Range-Specific-Requests-in-ASP-NET.aspxのバージョン) のクラスを使用して、ダウンロードをリーチから保護し、履歴書を提供します。それは正常に動作しますが、時々私は得る
System.Threading.ThreadAbortException: Thread was being aborted.
at System.Web.UnsafeNativeMethods.EcbFlushCore(IntPtr pECB, Byte[] status, Byte[] header, Int32 keepConnected, Int32 totalBodySize, Int32 numBodyFragments, IntPtr[] bodyFragments, Int32[] bodyFragmentLengths, Int32 doneWithSession, Int32 finalStatus, Int32 kernelCache, Int32 async, ISAPIAsyncCompletionCallback asyncCompletionCallback)
at System.Web.Hosting.ISAPIWorkerRequestInProcForIIS6.FlushCore(Byte[] status, Byte[] header, Int32 keepConnected, Int32 totalBodySize, Int32 numBodyFragments, IntPtr[] bodyFragments, Int32[] bodyFragmentLengths, Int32 doneWithSession, Int32 finalStatus, Boolean& async)
at System.Web.Hosting.ISAPIWorkerRequest.FlushCachedResponse(Boolean isFinal)
at System.Web.Hosting.ISAPIWorkerRequest.FlushResponse(Boolean finalFlush)
at System.Web.HttpResponse.Flush(Boolean finalFlush)
at System.Web.HttpResponse.Flush()
at ResumeDownload.ProcessDownload(String fileName, String headerFileName, String fileMimeType)
at FileDownloader.Page_Load(Object sender, EventArgs e)
私のサイトはモバイル サイトであり、さまざまな方法でダウンロードするさまざまなモバイル ブラウザーが無数に存在します。また、通常はオペレーターゲートウェイ経由で接続するため、クライアントの切断または wap プロキシの問題に関係していると思います。
私がやろうとしているのは、どうすればこれを止めることができるかということです。catc を試して無視したくありません。について読んだ
catch (ThreadAbortException ex)
と
Thread.ResetAbort();
しかし、それをクラスに正常に実装できませんでした。リーチングを保護するために同様のコードを使用した人はいますか?