FileWebResponse Class

Definition

提供 WebResponse 类的文件系统实现。Provides a file system implementation of the WebResponse class.

public ref class FileWebResponse : System::Net::WebResponse, System::Runtime::Serialization::ISerializable
public ref class FileWebResponse : System::Net::WebResponse, IDisposable, System::Runtime::Serialization::ISerializable
public ref class FileWebResponse : System::Net::WebResponse
public class FileWebResponse : System.Net.WebResponse, System.Runtime.Serialization.ISerializable
[System.Serializable]
public class FileWebResponse : System.Net.WebResponse, IDisposable, System.Runtime.Serialization.ISerializable
[System.Serializable]
public class FileWebResponse : System.Net.WebResponse, System.Runtime.Serialization.ISerializable
public class FileWebResponse : System.Net.WebResponse
type FileWebResponse = class
    inherit WebResponse
    interface ISerializable
type FileWebResponse = class
    inherit WebResponse
    interface ISerializable
    interface IDisposable
Public Class FileWebResponse
Inherits WebResponse
Implements ISerializable
Public Class FileWebResponse
Inherits WebResponse
Implements IDisposable, ISerializable
Public Class FileWebResponse
Inherits WebResponse
Inheritance
Attributes
Implements

Remarks

FileWebResponse 类实现了 WebResponseabstract 基类,以返回 FileWebRequest 类的文件系统资源。The FileWebResponse class implements the WebResponseabstract base class to return file system resources for the FileWebRequest class.

客户端应用程序不会直接创建 FileWebResponse 实例;相反,它们是通过对 FileWebRequest 实例调用 GetResponse 方法来创建的。Client applications do not create FileWebResponse instances directly; instead, they are created by calling the GetResponse method on a FileWebRequest instance.

GetResponseStream 方法返回一个 Stream 实例,该实例提供对文件系统资源的只读访问。The GetResponseStream method returns a Stream instance that provides read-only access to a file system resource.

FileWebResponse 类依赖于 File 类来实现错误处理和代码访问安全性。The FileWebResponse class relies on the File class for error handling and code access security.

Constructors

FileWebResponse(SerializationInfo, StreamingContext)

FileWebResponseSerializationInfo 类的指定实例初始化 StreamingContext 类的新实例。Initializes a new instance of the FileWebResponse class from the specified instances of the SerializationInfo and StreamingContext classes.

Properties

ContentLength

获取文件系统资源中的内容长度。Gets the length of the content in the file system resource.

ContentType

获取文件系统资源的内容类型。Gets the content type of the file system resource.

Headers

获取与响应关联的标头名称/值对集合。Gets a collection of header name/value pairs associated with the response.

IsFromCache

获取一个 Boolean 值,该值指示此响应是否为从缓存中获取的。Gets a Boolean value that indicates whether this response was obtained from the cache.

(Inherited from WebResponse)
IsMutuallyAuthenticated

获取一个 Boolean 值,该值指示是否发生了相互身份验证。Gets a Boolean value that indicates whether mutual authentication occurred.

(Inherited from WebResponse)
ResponseUri

获取提供响应的文件系统资源的 URI。Gets the URI of the file system resource that provided the response.

SupportsHeaders

获取一个值,该值指示 Headers 属性是否由 FileWebResponse 实例支持。Gets a value that indicates whether the Headers property is supported by the FileWebResponse instance.

SupportsHeaders

获取指示是否支持标题的值。Gets a value that indicates if headers are supported.

(Inherited from WebResponse)

Methods

Close()

关闭响应流。Closes the response stream.

CreateObjRef(Type)

创建一个对象,该对象包含生成用于与远程对象进行通信的代理所需的全部相关信息。Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.

(Inherited from MarshalByRefObject)
Dispose()

释放 WebResponse 对象使用的非托管资源。Releases the unmanaged resources used by the WebResponse object.

(Inherited from WebResponse)
Dispose(Boolean)

释放 FileWebResponse 使用的非托管资源,并选择性地释放托管资源。Releases the unmanaged resources used by the FileWebResponse and optionally releases the managed resources.

Dispose(Boolean)

释放由 WebResponse 对象使用的非托管资源,并可根据需要释放托管资源。Releases the unmanaged resources used by the WebResponse object, and optionally disposes of the managed resources.

(Inherited from WebResponse)
Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(Inherited from Object)
GetLifetimeService()

检索控制此实例的生存期策略的当前生存期服务对象。Retrieves the current lifetime service object that controls the lifetime policy for this instance.

(Inherited from MarshalByRefObject)
GetObjectData(SerializationInfo, StreamingContext)

使用序列化目标对象所需的数据填充 SerializationInfoPopulates a SerializationInfo with the data needed to serialize the target object.

GetObjectData(SerializationInfo, StreamingContext)

使用序列化目标对象所需的数据填充 SerializationInfoPopulates a SerializationInfo with the data that is needed to serialize the target object.

(Inherited from WebResponse)
GetResponseStream()

返回来自文件系统资源的数据流。Returns the data stream from the file system resource.

GetType()

获取当前实例的 TypeGets the Type of the current instance.

(Inherited from Object)
InitializeLifetimeService()

获取生存期服务对象来控制此实例的生存期策略。Obtains a lifetime service object to control the lifetime policy for this instance.

(Inherited from MarshalByRefObject)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(Inherited from Object)
MemberwiseClone(Boolean)

创建当前 MarshalByRefObject 对象的浅表副本。Creates a shallow copy of the current MarshalByRefObject object.

(Inherited from MarshalByRefObject)
ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(Inherited from Object)

Explicit Interface Implementations

IDisposable.Dispose()

释放 FileWebResponse 使用的所有资源。Releases all resources used by the FileWebResponse.

IDisposable.Dispose()

当在派生类中被重写时,释放 WebResponse 使用的所有资源。When overridden in a derived class, releases all resources used by the WebResponse.

(Inherited from WebResponse)
ISerializable.GetObjectData(SerializationInfo, StreamingContext)

用序列化 SerializationInfo 所需的数据填充 FileWebResponse 实例。Populates a SerializationInfo instance with the data needed to serialize the FileWebResponse.

Applies to