當前位置: 首頁>>代碼示例>>C#>>正文


C# Web.HttpWorkerRequest類代碼示例

本文整理匯總了C#中System.Web.HttpWorkerRequest的典型用法代碼示例。如果您正苦於以下問題:C# HttpWorkerRequest類的具體用法?C# HttpWorkerRequest怎麽用?C# HttpWorkerRequest使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


HttpWorkerRequest類屬於System.Web命名空間,在下文中一共展示了HttpWorkerRequest類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: ProgressWorkerRequest

 public ProgressWorkerRequest(HttpWorkerRequest wr, HttpRequest request)
 {
     this._originalWorkerRequest = wr;
     this._request = request;
     this._boundary = this.GetBoundary(this._request);
     this._requestStateStore = new Areas.Lib.UploadProgress.Upload.RequestStateStore(this._request.ContentEncoding);
 }
開發者ID:asifashraf,項目名稱:Radmade-Portable-Framework,代碼行數:7,代碼來源:ProgressWorkerRequest.cs

示例2: GetNextRequest

		public HttpWorkerRequest GetNextRequest (HttpWorkerRequest req)
		{
			if (!CanExecuteRequest (req)) {
				if (req != null) {
					lock (queue) {
						Queue (req);
					}
				}

				return null;
			}

			HttpWorkerRequest result;
			lock (queue) {
				result = Dequeue ();
				if (result != null) {
					if (req != null)
						Queue (req);
				} else {
					result = req;
				}
			}

			return result;
		}
開發者ID:jjenki11,項目名稱:blaze-chem-rendering,代碼行數:25,代碼來源:QueueManager.cs

示例3: TestWebContext

        public TestWebContext(string virtualPath, string page)
        {
            _out = new StringWriter();
            HttpWorkerRequest wr;
            AppDomain domain = Thread.GetDomain();

            // are we running within a valid AspNet AppDomain?
            string appPath = (string) domain.GetData(".appPath");
            if (appPath != null)
            {
                wr = new SimpleWorkerRequest(page, string.Empty, _out);
            }
            else
            {
                appPath = domain.BaseDirectory + "\\";
                wr = new SimpleWorkerRequest(virtualPath, appPath, page, string.Empty, _out);
            }
            HttpContext ctx = new HttpContext(wr);
            HttpContext.Current = ctx;
            HttpBrowserCapabilities browser = new HttpBrowserCapabilities();
            browser.Capabilities = new CaseInsensitiveHashtable(); //CollectionsUtil.CreateCaseInsensitiveHashtable();
            browser.Capabilities[string.Empty] = "Test User Agent"; // string.Empty is the key for "user agent"

            // avoids NullReferenceException when accessing HttpRequest.FilePath
            object virtualPathObject = ExpressionEvaluator.GetValue(null, "T(System.Web.VirtualPath).Create('/')");
            object cachedPathData = ExpressionEvaluator.GetValue(null, "T(System.Web.CachedPathData).GetRootWebPathData()");
            ExpressionEvaluator.SetValue(cachedPathData, "_virtualPath", virtualPathObject);
            ExpressionEvaluator.SetValue(cachedPathData, "_physicalPath", appPath);

            ctx.Request.Browser = browser;
            string filePath = ctx.Request.FilePath;
            _wr = wr;
        }
開發者ID:spring-projects,項目名稱:spring-net,代碼行數:33,代碼來源:TestWebContext.cs

示例4: DecoratedWorkerRequest

 protected DecoratedWorkerRequest(HttpWorkerRequest origWorker)
 {
     if (log.IsDebugEnabled) log.Debug("origWorker=" + origWorker);
     OrigWorker = origWorker;
     // Remember the original HttpContext so that it can be used by UploadHttpModule.AppendToLog().
     OrigContext = HttpContext.Current;
 }
開發者ID:abdul-baten,項目名稱:hbcms,代碼行數:7,代碼來源:DecoratedWorkerRequest.cs

示例5:

 void IHttpResponseElement.Send(HttpWorkerRequest wr)
 {
     int length = base._size - base._free;
     if (length > 0)
     {
         wr.SendResponseFromMemory(this._data, length);
     }
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:8,代碼來源:HttpResponseBufferElement.cs

示例6: HttpHeaderCollection

        // This constructor creates the header collection for response headers.
        // Try to preallocate the base collection with a size that should be sufficient
        // to store the headers for most requests.
        internal HttpHeaderCollection(HttpWorkerRequest wr, HttpResponse response, int capacity) : base(capacity) {

            // if this is an IIS7WorkerRequest, then the collection will be writeable and we will
            // call into IIS7 to update the header blocks when changes are made.
            _iis7WorkerRequest = wr as IIS7WorkerRequest;

            _response = response;
        }
開發者ID:iskiselev,項目名稱:JSIL.NetFramework,代碼行數:11,代碼來源:HttpHeaderCollection.cs

示例7: GetContext

 public static KeyValuePair<HttpContext, HttpApplication> GetContext(HttpWorkerRequest wr, params IHttpModule[] modules) {
     var ctx = new HttpContext(wr);
     var app = new MyApp(modules);
     SetHttpApplicationFactoryCustomApplication(app);
     InitInternal(app, ctx);
     AssignContext(app, ctx);
     return new KeyValuePair<HttpContext, HttpApplication>(ctx, app);
 }
開發者ID:nhsevidence,項目名稱:Windsor.LifeStyles,代碼行數:8,代碼來源:HttpModuleRunner.cs

示例8: CreateStream

        public static RequestBufferlessStream CreateStream(HttpWorkerRequest workerRequest)
        {
            if (workerRequest == null)
                throw new ArgumentNullException("workerRequest");

            long totalBytes = (long)workerRequest.GetTotalEntityBodyLength();
            return new RequestBufferlessStream(workerRequest, totalBytes);
        }
開發者ID:cloudguy,項目名稱:Storage-Monster,代碼行數:8,代碼來源:RequestBufferlessStream.cs

示例9: IntPtr

 void IHttpResponseElement.Send(HttpWorkerRequest wr)
 {
     if (this._size > 0)
     {
         bool isBufferFromUnmanagedPool = false;
         wr.SendResponseFromMemory(new IntPtr(this._data.ToInt64() + this._offset), this._size, isBufferFromUnmanagedPool);
     }
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:8,代碼來源:HttpResourceResponseElement.cs

示例10: CheckClientConnected

 private bool CheckClientConnected(HttpWorkerRequest wr)
 {
     if ((DateTime.UtcNow - wr.GetStartTime()) > this._clientConnectedTime)
     {
         return wr.IsClientConnected();
     }
     return true;
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:8,代碼來源:RequestQueue.cs

示例11: HttpServerVarsCollection

        // We preallocate the base collection with a size that should be sufficient
        // to store all server variables w/o having to expand
        internal HttpServerVarsCollection(HttpWorkerRequest wr, HttpRequest request) : base(59) {
            // if this is an IIS7WorkerRequest, then the collection will be writeable and we will
            // call into IIS7 to update the server var block when changes are made.
            _iis7workerRequest = wr as IIS7WorkerRequest;
            _request = request;
            _populated = false;

            Debug.Assert( _request != null );
        }
開發者ID:JokerMisfits,項目名稱:linux-packaging-mono,代碼行數:11,代碼來源:HttpServerVarsCollection.cs

示例12: CanExecuteRequest

		bool CanExecuteRequest (HttpWorkerRequest req)
		{
			if (disposing)
				return false;
				
			int threads, cports;
			ThreadPool.GetAvailableThreads (out threads, out cports);
			bool local = (req != null && req.GetLocalAddress () == "127.0.0.1");
			return (threads > minFree) || (local && threads > minLocalFree);
		}
開發者ID:jjenki11,項目名稱:blaze-chem-rendering,代碼行數:10,代碼來源:QueueManager.cs

示例13: HttpContext

		public HttpContext (HttpWorkerRequest WorkerRequest)
		{
			Context = this;

			_oTimestamp = DateTime.Now;
			_oRequest = new HttpRequest (WorkerRequest, this);
			_oResponse = new HttpResponse (WorkerRequest, this);
			_oWorkerRequest = WorkerRequest;
			_oTrace = new TraceContext (this);
		}
開發者ID:jjenki11,項目名稱:blaze-chem-rendering,代碼行數:10,代碼來源:HttpContext.cs

示例14: Send

 internal void Send(HttpWorkerRequest wr)
 {
     if (this._knownHeaderIndex >= 0)
     {
         wr.SendKnownResponseHeader(this._knownHeaderIndex, this._value);
     }
     else
     {
         wr.SendUnknownResponseHeader(this._unknownHeader, this._value);
     }
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:11,代碼來源:HttpResponseHeader.cs

示例15: RequestStream

		public RequestStream(HttpWorkerRequest request)
		{
			this.request = request;

			tempBuff = request.GetPreloadedEntityBody();

            _contentLength = long.Parse(request.GetKnownRequestHeader(HttpWorkerRequest.HeaderContentLength));
            
            // Handle the case where GetPreloadedEntityBody is null -- e.g. Mono
			if (tempBuff == null || tempBuff.Length == 0)
			{
				isInPreloaded = false;
			}
    	}
開發者ID:codingbat,項目名稱:BandCamp,代碼行數:14,代碼來源:RequestStream.cs


注:本文中的System.Web.HttpWorkerRequest類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。