当前位置: 首页>>代码示例>>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;未经允许,请勿转载。