Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / Net / System / Net / WebResponse.cs / 1 / WebResponse.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Net { using System.Collections; 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.] ///[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.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.] ///[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
- QuotedPrintableStream.cs
- HttpApplicationStateWrapper.cs
- WebPartEditorOkVerb.cs
- DataGridViewCellCollection.cs
- Invariant.cs
- XmlSerializationReader.cs
- WizardStepBase.cs
- ApplicationCommands.cs
- UnicastIPAddressInformationCollection.cs
- FrameworkRichTextComposition.cs
- TextControl.cs
- Point4D.cs
- Errors.cs
- PathParser.cs
- PeerPresenceInfo.cs
- Panel.cs
- DateBoldEvent.cs
- DataGridViewControlCollection.cs
- basecomparevalidator.cs
- BeginEvent.cs
- DocumentXPathNavigator.cs
- CustomSignedXml.cs
- ToolStripDropTargetManager.cs
- SmiEventSink_DeferedProcessing.cs
- ExcludePathInfo.cs
- Accessors.cs
- SmiMetaData.cs
- FormViewInsertedEventArgs.cs
- TypeHelpers.cs
- PersistNameAttribute.cs
- SpeechDetectedEventArgs.cs
- BrushMappingModeValidation.cs
- ContentPresenter.cs
- ScrollViewer.cs
- GroupLabel.cs
- DesignerListAdapter.cs
- AnimationStorage.cs
- ResXDataNode.cs
- ConfigXmlSignificantWhitespace.cs
- SocketElement.cs
- WebPartDescription.cs
- SystemIPv6InterfaceProperties.cs
- WindowVisualStateTracker.cs
- Visual3D.cs
- LineProperties.cs
- ThreadLocal.cs
- StateChangeEvent.cs
- EdmRelationshipNavigationPropertyAttribute.cs
- WindowsAuthenticationEventArgs.cs
- LoginUtil.cs
- IssuedSecurityTokenParameters.cs
- DataControlButton.cs
- HyperLinkStyle.cs
- XsltQilFactory.cs
- WmlMobileTextWriter.cs
- CallbackHandler.cs
- HTMLTagNameToTypeMapper.cs
- ProfileEventArgs.cs
- HttpWebRequest.cs
- MetadataItem.cs
- InstanceData.cs
- CalendarDayButton.cs
- UInt32Storage.cs
- DocumentApplicationState.cs
- FamilyTypefaceCollection.cs
- AnnotationHighlightLayer.cs
- RepeatBehaviorConverter.cs
- ProxyWebPartManager.cs
- XmlUtf8RawTextWriter.cs
- MaxMessageSizeStream.cs
- HuffModule.cs
- AnimationStorage.cs
- SymmetricCryptoHandle.cs
- JsonEncodingStreamWrapper.cs
- AstTree.cs
- CopyNodeSetAction.cs
- TrustLevelCollection.cs
- CodeTypeMember.cs
- UnsafeNetInfoNativeMethods.cs
- SqlTrackingWorkflowInstance.cs
- DataRecord.cs
- WindowsSysHeader.cs
- OletxVolatileEnlistment.cs
- MruCache.cs
- NullableFloatAverageAggregationOperator.cs
- FunctionImportMapping.cs
- AttributeUsageAttribute.cs
- ZoomingMessageFilter.cs
- OrCondition.cs
- QilNode.cs
- ValidationSummary.cs
- CheckBoxRenderer.cs
- ClockGroup.cs
- ActivityPropertyReference.cs
- ScriptResourceHandler.cs
- ReadOnlyHierarchicalDataSource.cs
- RootBuilder.cs
- ImageInfo.cs
- BroadcastEventHelper.cs
- X509AsymmetricSecurityKey.cs