HttpResponseWrapper.WriteFile 方法

定義

將指定的檔案寫入 HTTP 回應輸出資料流。Writes the specified file to the HTTP response output stream.

多載

WriteFile(IntPtr, Int64, Int64)

將指定的檔案寫入 HTTP 回應輸出資料流。Writes the specified file to the HTTP response output stream.

WriteFile(String, Int64, Int64)

將指定的檔案寫入 HTTP 回應輸出資料流。Writes the specified file to the HTTP response output stream.

WriteFile(String)

將指定的檔案內容寫入 HTTP 回應輸出資料流,做為檔案區塊。Writes the contents of the specified file to the HTTP response output stream as a file block.

WriteFile(String, Boolean)

將指定檔案的內容寫入 HTTP 回應輸出資料流,並指定是否將內容寫入為記憶體區塊。Writes the contents of the specified file to the HTTP response output stream and specifies whether the content is written as a memory block.

WriteFile(IntPtr, Int64, Int64)

將指定的檔案寫入 HTTP 回應輸出資料流。Writes the specified file to the HTTP response output stream.

public:
 override void WriteFile(IntPtr fileHandle, long offset, long size);
public override void WriteFile (IntPtr fileHandle, long offset, long size);
override this.WriteFile : nativeint * int64 * int64 -> unit
Public Overrides Sub WriteFile (fileHandle As IntPtr, offset As Long, size As Long)

參數

fileHandle
IntPtr

要寫入 HTTP 輸出資料流之檔案的檔案控制代碼 (File Handle)。The file handle of the file to write to the HTTP output stream.

offset
Int64

檔案中開始寫入的位置。The position in the file where writing starts.

size
Int64

要從 offset 開始寫入的位元組數目。The number of bytes to write, starting at offset.

例外狀況

fileHandlenullfileHandle is null.

offset 小於 0。offset is less than 0.

-或--or-

size 大於檔案大小減去 offsetsize is greater than the file size minus offset.

適用於

WriteFile(String, Int64, Int64)

將指定的檔案寫入 HTTP 回應輸出資料流。Writes the specified file to the HTTP response output stream.

public:
 override void WriteFile(System::String ^ filename, long offset, long size);
public override void WriteFile (string filename, long offset, long size);
override this.WriteFile : string * int64 * int64 -> unit
Public Overrides Sub WriteFile (filename As String, offset As Long, size As Long)

參數

filename
String

要寫入 HTTP 輸出資料流的檔案名稱。The name of the file to write to the HTTP output stream.

offset
Int64

檔案中開始寫入的位置。The position in the file where writing starts.

size
Int64

要從 offset 開始寫入的位元組數目。The number of bytes to write, starting at offset.

例外狀況

offset 小於 0。offset is less than 0.

-或--or-

size 大於檔案大小減去 offsetsize is greater than the file size minus offset.

適用於

WriteFile(String)

將指定的檔案內容寫入 HTTP 回應輸出資料流,做為檔案區塊。Writes the contents of the specified file to the HTTP response output stream as a file block.

public:
 override void WriteFile(System::String ^ filename);
public override void WriteFile (string filename);
override this.WriteFile : string -> unit
Public Overrides Sub WriteFile (filename As String)

參數

filename
String

要寫入 HTTP 輸出資料流的檔案名稱。The name of the file to write to the HTTP output stream.

例外狀況

filename 參數為 nullThe filename parameter is null.

適用於

WriteFile(String, Boolean)

將指定檔案的內容寫入 HTTP 回應輸出資料流,並指定是否將內容寫入為記憶體區塊。Writes the contents of the specified file to the HTTP response output stream and specifies whether the content is written as a memory block.

public:
 override void WriteFile(System::String ^ filename, bool readIntoMemory);
public override void WriteFile (string filename, bool readIntoMemory);
override this.WriteFile : string * bool -> unit
Public Overrides Sub WriteFile (filename As String, readIntoMemory As Boolean)

參數

filename
String

要寫入目前回應之檔案的名稱。The name of the file to write to the current response.

readIntoMemory
Boolean

true 表示將檔案寫入至記憶體區塊,否則為 false。true to write the file into a memory block.

例外狀況

filename 參數為 nullThe filename parameter is null.

適用於