FileWebResponse FileWebResponse FileWebResponse FileWebResponse Class

定義

提供 WebResponse 類別的檔案系統實作。Provides a file system implementation of the WebResponse class.

public ref class FileWebResponse : System::Net::WebResponse, System::Runtime::Serialization::ISerializable
[System.Serializable]
public class FileWebResponse : System.Net.WebResponse, System.Runtime.Serialization.ISerializable
type FileWebResponse = class
    inherit WebResponse
    interface ISerializable
Public Class FileWebResponse
Inherits WebResponse
Implements ISerializable
繼承
屬性
實作

備註

FileWebResponse類別會實作WebResponseabstract基底類別,以傳回檔案系統資源FileWebRequest類別。The FileWebResponse class implements the WebResponseabstract base class to return file system resources for the FileWebRequest class.

用戶端應用程式不會建立FileWebResponse執行個體直接; 相反地,它們會藉由呼叫GetResponse方法FileWebRequest執行個體。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.

建構函式

FileWebResponse(SerializationInfo, StreamingContext) FileWebResponse(SerializationInfo, StreamingContext) FileWebResponse(SerializationInfo, StreamingContext) FileWebResponse(SerializationInfo, StreamingContext)

初始化 FileWebResponse 類別的新執行個體,這個執行個體是來自 SerializationInfoStreamingContext 類別的指定執行個體。Initializes a new instance of the FileWebResponse class from the specified instances of the SerializationInfo and StreamingContext classes.

屬性

ContentLength ContentLength ContentLength ContentLength

取得檔案系統資源內容的長度。Gets the length of the content in the file system resource.

ContentType ContentType ContentType ContentType

取得檔案系統資源的內容類型。Gets the content type of the file system resource.

Headers Headers Headers Headers

取得與回應相關聯標頭名稱/值組的集合。Gets a collection of header name/value pairs associated with the response.

IsFromCache IsFromCache IsFromCache IsFromCache

取得 Boolean 值,指出這個回應是否從快取中取得。Gets a Boolean value that indicates whether this response was obtained from the cache.

(Inherited from WebResponse)
IsMutuallyAuthenticated IsMutuallyAuthenticated IsMutuallyAuthenticated IsMutuallyAuthenticated

取得 Boolean 值,指出是否發生過相互驗證。Gets a Boolean value that indicates whether mutual authentication occurred.

(Inherited from WebResponse)
ResponseUri ResponseUri ResponseUri ResponseUri

取得提供回應的檔案系統資源 URI。Gets the URI of the file system resource that provided the response.

SupportsHeaders SupportsHeaders SupportsHeaders SupportsHeaders

取得值,這個值表示 Headers 執行個體是否支援 FileWebResponse 屬性。Gets a value that indicates whether the Headers property is supported by the FileWebResponse instance.

方法

Close() Close() Close() Close()

關閉回應資料流。Closes the response stream.

CreateObjRef(Type) CreateObjRef(Type) CreateObjRef(Type) CreateObjRef(Type)

建立包含所有相關資訊的物件,這些資訊是產生用來與遠端物件通訊的所需 Proxy。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() Dispose() Dispose() Dispose()

釋放由 WebResponse 物件使用的 Unmanaged 資源。Releases the unmanaged resources used by the WebResponse object.

(Inherited from WebResponse)
Dispose(Boolean) Dispose(Boolean) Dispose(Boolean) Dispose(Boolean)

釋放 FileWebResponse 所使用的 Unmanaged 資源,並選擇性地釋放 Managed 資源。Releases the unmanaged resources used by the FileWebResponse and optionally releases the managed resources.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(Inherited from Object)
GetLifetimeService() GetLifetimeService() GetLifetimeService() GetLifetimeService()

擷取控制這個執行個體存留期 (Lifetime) 原則的目前存留期服務物件。Retrieves the current lifetime service object that controls the lifetime policy for this instance.

(Inherited from MarshalByRefObject)
GetObjectData(SerializationInfo, StreamingContext) GetObjectData(SerializationInfo, StreamingContext) GetObjectData(SerializationInfo, StreamingContext) GetObjectData(SerializationInfo, StreamingContext)

將序列化目標物件所需的資料填入 SerializationInfoPopulates a SerializationInfo with the data needed to serialize the target object.

GetResponseStream() GetResponseStream() GetResponseStream() GetResponseStream()

從檔案系統資源傳回資料流。Returns the data stream from the file system resource.

GetType() GetType() GetType() GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(Inherited from Object)
InitializeLifetimeService() InitializeLifetimeService() InitializeLifetimeService() InitializeLifetimeService()

取得存留期服務物件,以控制這個執行個體的存留期原則。Obtains a lifetime service object to control the lifetime policy for this instance.

(Inherited from MarshalByRefObject)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(Inherited from Object)
MemberwiseClone(Boolean) MemberwiseClone(Boolean) MemberwiseClone(Boolean) MemberwiseClone(Boolean)

建立目前 MarshalByRefObject 物件的淺層複本。Creates a shallow copy of the current MarshalByRefObject object.

(Inherited from MarshalByRefObject)
ToString() ToString() ToString() ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(Inherited from Object)

明確介面實作

IDisposable.Dispose() IDisposable.Dispose() IDisposable.Dispose() IDisposable.Dispose()

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

ISerializable.GetObjectData(SerializationInfo, StreamingContext) ISerializable.GetObjectData(SerializationInfo, StreamingContext) ISerializable.GetObjectData(SerializationInfo, StreamingContext) ISerializable.GetObjectData(SerializationInfo, StreamingContext)

以序列化 SerializationInfo 所需的資料填入 FileWebResponse 執行個體。Populates a SerializationInfo instance with the data needed to serialize the FileWebResponse.

適用於