상속: System.IO.FileStream, ICloseEx
예제 #1
0
        private WebResponse GetResponseInternal()
        {
            if (webResponse != null)
            {
                return(webResponse);
            }
            lock (this)
            {
                if (requesting)
                {
                    requestEndEvent = new AutoResetEvent(initialState: false);
                }
            }
            if (requestEndEvent != null)
            {
                requestEndEvent.WaitOne();
            }
            FileStream fileStream = null;

            try
            {
                fileStream = new FileWebStream(this, FileMode.Open, FileAccess.Read, FileShare.Read);
            }
            catch (Exception ex)
            {
                throw new WebException(ex.Message, ex);
                IL_0073 :;
            }
            webResponse = new FileWebResponse(uri, fileStream);
            return(webResponse);
        }
예제 #2
0
        WebResponse GetResponseInternal()
        {
            if (webResponse != null)
            {
                return(webResponse);
            }
            lock (this) {
                if (requesting)
                {
                    requestEndEvent = new AutoResetEvent(false);
                }
            }
            if (requestEndEvent != null)
            {
                requestEndEvent.WaitOne();
            }
            FileStream fileStream = null;

            try {
                fileStream       = new FileWebStream(this, FileMode.Open, FileAccess.Read, FileShare.Read);
                this.webResponse = new FileWebResponse(this.uri, fileStream);
            } catch (Exception ex) {
                this.webResponse = new FileWebResponse(this.uri, new WebException(ex.Message, ex));
            }
            return(this.webResponse);
        }
예제 #3
0
		WebResponse GetResponseInternal ()
		{
			if (webResponse != null)
				return webResponse;
			lock (this) {
				if (requesting) {
					requestEndEvent = new AutoResetEvent (false);
				}
			}
			if (requestEndEvent != null) {
				requestEndEvent.WaitOne ();
			}
			FileStream fileStream = null;
			try {
				fileStream = new FileWebStream (this, FileMode.Open, FileAccess.Read, FileShare.Read);
				this.webResponse = new FileWebResponse (this.uri, fileStream);
			} catch (Exception ex) {
				this.webResponse = new FileWebResponse (this.uri, new WebException (ex.Message, ex));
			}
			return this.webResponse;
		}