Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Net / System / Net / WebResponse.cs / 1305376 / WebResponse.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Net { using System.Collections; using System.Diagnostics.CodeAnalysis; using System.IO; using System.Runtime.Serialization; using System.Security.Permissions; /*++ WebResponse - The abstract base class for all WebResponse objects. --*/ ////// [Serializable] public abstract class WebResponse : MarshalByRefObject, ISerializable, IDisposable { private bool m_IsCacheFresh; private bool m_IsFromCache; ////// A /// response from a Uniform Resource Indentifier (Uri). This is an abstract class. /// ////// protected WebResponse() { } // // ISerializable constructor // ///Initializes a new /// instance of the ////// class. /// protected WebResponse(SerializationInfo serializationInfo, StreamingContext streamingContext) { } // // ISerializable method // ///[To be supplied.] ///[SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase", Justification = "System.dll is still using pre-v4 security model and needs this demand")] [SecurityPermission(SecurityAction.LinkDemand, Flags=SecurityPermissionFlag.SerializationFormatter, SerializationFormatter=true)] void ISerializable.GetObjectData(SerializationInfo serializationInfo, StreamingContext streamingContext) { GetObjectData(serializationInfo, streamingContext); } // // FxCop: provide a way for derived classes to access this method even if they reimplement ISerializable. // [SecurityPermission(SecurityAction.Demand, SerializationFormatter=true)] protected virtual void GetObjectData(SerializationInfo serializationInfo, StreamingContext streamingContext) { } /*++ Close - Closes the Response after the use. This causes the read stream to be closed. --*/ public virtual void Close() { throw ExceptionHelper.MethodNotImplementedException; } /// void IDisposable.Dispose() { try { Close(); OnDispose(); } catch { } } internal virtual void OnDispose(){ } public virtual bool IsFromCache { get {return m_IsFromCache;} } internal bool InternalSetFromCache { set { m_IsFromCache = value; } } internal virtual bool IsCacheFresh { get {return m_IsCacheFresh;} } internal bool InternalSetIsCacheFresh { set { m_IsCacheFresh = value; } } public virtual bool IsMutuallyAuthenticated { get {return false;} } /*++ ContentLength - Content length of response. This property returns the content length of the response. --*/ /// /// public virtual long ContentLength { get { throw ExceptionHelper.PropertyNotImplementedException; } set { throw ExceptionHelper.PropertyNotImplementedException; } } /*++ ContentType - Content type of response. This property returns the content type of the response. --*/ ///When overridden in a derived class, gets or /// sets /// the content length of data being received. ////// public virtual string ContentType { get { throw ExceptionHelper.PropertyNotImplementedException; } set { throw ExceptionHelper.PropertyNotImplementedException; } } /*++ ResponseStream - Get the response stream for this response. This property returns the response stream for this WebResponse. Input: Nothing. Returns: Response stream for response. read-only --*/ ///When overridden in a derived class, /// gets /// or sets the content type of the data being received. ////// public virtual Stream GetResponseStream() { throw ExceptionHelper.MethodNotImplementedException; } /*++ ResponseUri - Gets the final Response Uri, that includes any changes that may have transpired from the orginal request This property returns Uri for this WebResponse. Input: Nothing. Returns: Response Uri for response. read-only --*/ ///When overridden in a derived class, returns the ///object used /// for reading data from the resource referenced in the /// object. /// public virtual Uri ResponseUri { // read-only get { throw ExceptionHelper.PropertyNotImplementedException; } } /*++ Headers - Gets any request specific headers associated with this request, this is simply a name/value pair collection Input: Nothing. Returns: This property returns WebHeaderCollection. read-only --*/ ///When overridden in a derived class, gets the Uri that /// actually responded to the request. ////// public virtual WebHeaderCollection Headers { // read-only get { throw ExceptionHelper.PropertyNotImplementedException; } } }; // class WebResponse } // namespace System.Net // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //When overridden in a derived class, gets /// a collection of header name-value pairs associated with this /// request. ///// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Net { using System.Collections; using System.Diagnostics.CodeAnalysis; using System.IO; using System.Runtime.Serialization; using System.Security.Permissions; /*++ WebResponse - The abstract base class for all WebResponse objects. --*/ ////// [Serializable] public abstract class WebResponse : MarshalByRefObject, ISerializable, IDisposable { private bool m_IsCacheFresh; private bool m_IsFromCache; ////// A /// response from a Uniform Resource Indentifier (Uri). This is an abstract class. /// ////// protected WebResponse() { } // // ISerializable constructor // ///Initializes a new /// instance of the ////// class. /// protected WebResponse(SerializationInfo serializationInfo, StreamingContext streamingContext) { } // // ISerializable method // ///[To be supplied.] ///[SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase", Justification = "System.dll is still using pre-v4 security model and needs this demand")] [SecurityPermission(SecurityAction.LinkDemand, Flags=SecurityPermissionFlag.SerializationFormatter, SerializationFormatter=true)] void ISerializable.GetObjectData(SerializationInfo serializationInfo, StreamingContext streamingContext) { GetObjectData(serializationInfo, streamingContext); } // // FxCop: provide a way for derived classes to access this method even if they reimplement ISerializable. // [SecurityPermission(SecurityAction.Demand, SerializationFormatter=true)] protected virtual void GetObjectData(SerializationInfo serializationInfo, StreamingContext streamingContext) { } /*++ Close - Closes the Response after the use. This causes the read stream to be closed. --*/ public virtual void Close() { throw ExceptionHelper.MethodNotImplementedException; } /// void IDisposable.Dispose() { try { Close(); OnDispose(); } catch { } } internal virtual void OnDispose(){ } public virtual bool IsFromCache { get {return m_IsFromCache;} } internal bool InternalSetFromCache { set { m_IsFromCache = value; } } internal virtual bool IsCacheFresh { get {return m_IsCacheFresh;} } internal bool InternalSetIsCacheFresh { set { m_IsCacheFresh = value; } } public virtual bool IsMutuallyAuthenticated { get {return false;} } /*++ ContentLength - Content length of response. This property returns the content length of the response. --*/ /// /// public virtual long ContentLength { get { throw ExceptionHelper.PropertyNotImplementedException; } set { throw ExceptionHelper.PropertyNotImplementedException; } } /*++ ContentType - Content type of response. This property returns the content type of the response. --*/ ///When overridden in a derived class, gets or /// sets /// the content length of data being received. ////// public virtual string ContentType { get { throw ExceptionHelper.PropertyNotImplementedException; } set { throw ExceptionHelper.PropertyNotImplementedException; } } /*++ ResponseStream - Get the response stream for this response. This property returns the response stream for this WebResponse. Input: Nothing. Returns: Response stream for response. read-only --*/ ///When overridden in a derived class, /// gets /// or sets the content type of the data being received. ////// public virtual Stream GetResponseStream() { throw ExceptionHelper.MethodNotImplementedException; } /*++ ResponseUri - Gets the final Response Uri, that includes any changes that may have transpired from the orginal request This property returns Uri for this WebResponse. Input: Nothing. Returns: Response Uri for response. read-only --*/ ///When overridden in a derived class, returns the ///object used /// for reading data from the resource referenced in the /// object. /// public virtual Uri ResponseUri { // read-only get { throw ExceptionHelper.PropertyNotImplementedException; } } /*++ Headers - Gets any request specific headers associated with this request, this is simply a name/value pair collection Input: Nothing. Returns: This property returns WebHeaderCollection. read-only --*/ ///When overridden in a derived class, gets the Uri that /// actually responded to the request. ////// public virtual WebHeaderCollection Headers { // read-only get { throw ExceptionHelper.PropertyNotImplementedException; } } }; // class WebResponse } // namespace System.Net // File provided for Reference Use Only by Microsoft Corporation (c) 2007.When overridden in a derived class, gets /// a collection of header name-value pairs associated with this /// request. ///
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- HttpGetServerProtocol.cs
- DockPatternIdentifiers.cs
- VisualProxy.cs
- CellLabel.cs
- PartialList.cs
- Mapping.cs
- EdmScalarPropertyAttribute.cs
- BitmapSizeOptions.cs
- ISCIIEncoding.cs
- glyphs.cs
- Statements.cs
- CustomValidator.cs
- processwaithandle.cs
- ImageListStreamer.cs
- BoundsDrawingContextWalker.cs
- UnsafeNativeMethodsPenimc.cs
- CanonicalFormWriter.cs
- ButtonFlatAdapter.cs
- ConnectionManagementElement.cs
- OracleConnectionStringBuilder.cs
- DbConnectionPoolOptions.cs
- FacetDescriptionElement.cs
- SafeSystemMetrics.cs
- SchemaLookupTable.cs
- DropDownList.cs
- FlowNode.cs
- RecordManager.cs
- PropertyDescriptorGridEntry.cs
- IndexedString.cs
- NameValuePermission.cs
- XmlCharCheckingWriter.cs
- WrappedIUnknown.cs
- ExpandCollapseProviderWrapper.cs
- WindowsHyperlink.cs
- XmlWrappingWriter.cs
- SmtpReplyReader.cs
- UpDownBase.cs
- RegexWriter.cs
- Comparer.cs
- ConfigXmlWhitespace.cs
- NetworkStream.cs
- AuthenticationException.cs
- DocumentViewer.cs
- SafeEventLogReadHandle.cs
- HandlerBase.cs
- AutomationTextAttribute.cs
- WmlSelectionListAdapter.cs
- MetadataHelper.cs
- ColorMatrix.cs
- SetterBaseCollection.cs
- BitVector32.cs
- ContextQuery.cs
- TextSpanModifier.cs
- TraceEventCache.cs
- DataBindingCollection.cs
- RegexGroupCollection.cs
- InplaceBitmapMetadataWriter.cs
- invalidudtexception.cs
- KeySpline.cs
- Error.cs
- WindowCollection.cs
- AssemblyInfo.cs
- recordstatefactory.cs
- ExtensionQuery.cs
- _NegoState.cs
- WinInetCache.cs
- MailWebEventProvider.cs
- BamlResourceContent.cs
- DetailsViewRowCollection.cs
- NewItemsContextMenuStrip.cs
- cookieexception.cs
- DeviceFiltersSection.cs
- InfoCardCryptoHelper.cs
- _emptywebproxy.cs
- CatalogPartCollection.cs
- PersistenceTypeAttribute.cs
- SqlErrorCollection.cs
- DomainUpDown.cs
- Span.cs
- OpCodes.cs
- HelpHtmlBuilder.cs
- WebPartVerb.cs
- GcSettings.cs
- CngKey.cs
- SystemColors.cs
- IgnoreSection.cs
- KeyEventArgs.cs
- HandleRef.cs
- RequestDescription.cs
- WCFServiceClientProxyGenerator.cs
- TTSEvent.cs
- CodeExporter.cs
- PeerApplicationLaunchInfo.cs
- ImageButton.cs
- ProjectedSlot.cs
- NavigationPropertyEmitter.cs
- arclist.cs
- remotingproxy.cs
- UrlPath.cs
- FormViewInsertEventArgs.cs