HttpResponseBase.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:
virtual void WriteFile(IntPtr fileHandle, long offset, long size);
public virtual void WriteFile (IntPtr fileHandle, long offset, long size);
abstract member WriteFile : nativeint * int64 * int64 -> unit
override this.WriteFile : nativeint * int64 * int64 -> unit
Public Overridable Sub WriteFile (fileHandle As IntPtr, offset As Long, size As Long)
参数
- fileHandle
- IntPtr
要写入 HTTP 输出流的文件的文件句柄。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.
例外
始终。Always.
适用于
WriteFile(String, Int64, Int64)
将指定文件写入 HTTP 响应输出流。Writes the specified file to the HTTP response output stream.
public:
virtual void WriteFile(System::String ^ filename, long offset, long size);
public virtual void WriteFile (string filename, long offset, long size);
abstract member WriteFile : string * int64 * int64 -> unit
override this.WriteFile : string * int64 * int64 -> unit
Public Overridable 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.
例外
始终。Always.
适用于
WriteFile(String)
将指定文件的内容作为文件块写入 HTTP 响应输出流。Writes the contents of the specified file to the HTTP response output stream as a file block.
public:
virtual void WriteFile(System::String ^ filename);
public virtual void WriteFile (string filename);
abstract member WriteFile : string -> unit
override this.WriteFile : string -> unit
Public Overridable Sub WriteFile (filename As String)
参数
- filename
- String
要写入 HTTP 输出流的文件名。The name of the file to write to the HTTP output stream.
例外
始终。Always.
适用于
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:
virtual void WriteFile(System::String ^ filename, bool readIntoMemory);
public virtual void WriteFile (string filename, bool readIntoMemory);
abstract member WriteFile : string * bool -> unit
override this.WriteFile : string * bool -> unit
Public Overridable Sub WriteFile (filename As String, readIntoMemory As Boolean)
参数
- filename
- String
要写入当前响应的文件的名称。The name of the file to write to the current response.
- readIntoMemory
- Boolean
如果为 true,则将文件写入内存块。true to write the file into a memory block.
例外
始终。Always.