Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / 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.
--*/
///
///
/// A
/// response from a Uniform Resource Indentifier (Uri). This is an abstract class.
///
///
[Serializable]
public abstract class WebResponse : MarshalByRefObject, ISerializable, IDisposable {
private bool m_IsCacheFresh;
private bool m_IsFromCache;
///
/// Initializes a new
/// instance of the
/// class.
///
protected WebResponse() {
}
//
// ISerializable constructor
//
///
/// [To be supplied.]
///
protected WebResponse(SerializationInfo serializationInfo, StreamingContext streamingContext) {
}
//
// ISerializable method
//
///
[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.
--*/
///
/// When overridden in a derived class, gets or
/// sets
/// the content length of data being received.
///
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 type of the 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, returns the object used
/// for reading data from the resource referenced in the
/// object.
///
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, gets the Uri that
/// actually responded to the request.
///
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
/// a collection of header name-value pairs associated with this
/// request.
///
public virtual WebHeaderCollection Headers {
// read-only
get {
throw ExceptionHelper.PropertyNotImplementedException;
}
}
}; // class WebResponse
} // namespace System.Net
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- InlinedAggregationOperator.cs
- NameSpaceExtractor.cs
- DrawListViewSubItemEventArgs.cs
- DataSourceControl.cs
- MediaContextNotificationWindow.cs
- ActionFrame.cs
- EntityAdapter.cs
- FontDialog.cs
- SchemaImporter.cs
- LinqDataSourceSelectEventArgs.cs
- SoapCodeExporter.cs
- SpeechDetectedEventArgs.cs
- TreeNodeBinding.cs
- FontFamilyIdentifier.cs
- AuthenticationModulesSection.cs
- FunctionUpdateCommand.cs
- ProfilePropertySettingsCollection.cs
- XamlClipboardData.cs
- InteropAutomationProvider.cs
- Root.cs
- AddInAdapter.cs
- DataKeyArray.cs
- PrimaryKeyTypeConverter.cs
- Assert.cs
- ObjectViewFactory.cs
- AuthorizationRuleCollection.cs
- HTMLTagNameToTypeMapper.cs
- CommandHelper.cs
- VerificationException.cs
- _NetworkingPerfCounters.cs
- TabControlAutomationPeer.cs
- COM2ExtendedBrowsingHandler.cs
- ComAwareEventInfo.cs
- SQLMoneyStorage.cs
- PropertyGroupDescription.cs
- _FtpDataStream.cs
- GridViewPageEventArgs.cs
- DataListItemEventArgs.cs
- TextStore.cs
- DrawingDrawingContext.cs
- ZipFileInfo.cs
- AsymmetricSignatureDeformatter.cs
- EntityViewGenerationAttribute.cs
- ControlEvent.cs
- _WinHttpWebProxyDataBuilder.cs
- SuppressMessageAttribute.cs
- IDispatchConstantAttribute.cs
- DeviceContext2.cs
- Normalization.cs
- Properties.cs
- PeerCollaboration.cs
- CompilationRelaxations.cs
- MembershipSection.cs
- ZipIOLocalFileHeader.cs
- SmiContextFactory.cs
- ContentType.cs
- StatusBarPanel.cs
- ViewPort3D.cs
- SqlDeflator.cs
- RewritingPass.cs
- LineServicesCallbacks.cs
- DataSetSchema.cs
- DrawingCollection.cs
- ControlValuePropertyAttribute.cs
- ResourcePermissionBaseEntry.cs
- DoubleKeyFrameCollection.cs
- Directory.cs
- ToolStripControlHost.cs
- PageParser.cs
- ConfigUtil.cs
- EDesignUtil.cs
- WebPartMenu.cs
- EventEntry.cs
- RuleInfoComparer.cs
- ToolBarTray.cs
- ToolTipAutomationPeer.cs
- KeyValueSerializer.cs
- XPathBinder.cs
- CommandField.cs
- SystemFonts.cs
- SpStreamWrapper.cs
- DataTemplateKey.cs
- PathTooLongException.cs
- HostingEnvironmentWrapper.cs
- PrefixHandle.cs
- WebPartEventArgs.cs
- DataQuery.cs
- Image.cs
- SyndicationElementExtension.cs
- MatrixCamera.cs
- StylusPlugin.cs
- DataGridState.cs
- DataGridViewCellStyle.cs
- PrimaryKeyTypeConverter.cs
- ContainerParaClient.cs
- LogicalExpressionEditor.cs
- RequestQueryProcessor.cs
- sqlmetadatafactory.cs
- SchemaConstraints.cs
- SqlHelper.cs