HttpPostedFileWrapper 类
定义
封装 HTTP 固有对象,通过它可以访问客户端上载的各个文件。Encapsulates the HTTP intrinsic object that provides access to individual files that have been uploaded by a client.
public ref class HttpPostedFileWrapper : System::Web::HttpPostedFileBase
public class HttpPostedFileWrapper : System.Web.HttpPostedFileBase
type HttpPostedFileWrapper = class
inherit HttpPostedFileBase
Public Class HttpPostedFileWrapper
Inherits HttpPostedFileBase
- 继承
注解
HttpPostedFileWrapper类派生自 HttpPostedFileBase 类,用作类的包装 HttpPostedFile 。The HttpPostedFileWrapper class derives from the HttpPostedFileBase class and serves as a wrapper for the HttpPostedFile class. 此类公开类的功能, HttpPostedFile 同时公开 HttpPostedFileBase 类型。This class exposes the functionality of the HttpPostedFile class while also exposing the HttpPostedFileBase type. HttpPostedFileBase通过类,可以将应用程序中类的原始实现替换为 HttpPostedFile 自定义实现,例如在 ASP.NET 管道之外执行单元测试时。The HttpPostedFileBase class enables you to replace the original implementation of the HttpPostedFile class in your application with a custom implementation, such as when you perform unit testing outside the ASP.NET pipeline.
构造函数
| HttpPostedFileWrapper(HttpPostedFile) |
初始化 HttpPostedFileWrapper 类的新实例。Initializes a new instance of the HttpPostedFileWrapper class. |
属性
| ContentLength |
获取已上载文件的大小(以字节为单位)。Gets the size of an uploaded file, in bytes. |
| ContentType |
获取已上载文件的 MIME 内容类型。Gets the MIME content type of an uploaded file. |
| FileName |
获取客户端上文件的完全限定名称。Gets the fully qualified name of the file on the client. |
| InputStream |
获取一个 Stream 对象,该对象指向一个上载文件,以准备读取该文件的内容。Gets a Stream object that points to an uploaded file to prepare for reading the contents of the file. |
方法
| Equals(Object) |
确定指定对象是否等于当前对象。Determines whether the specified object is equal to the current object. (继承自 Object) |
| GetHashCode() |
作为默认哈希函数。Serves as the default hash function. (继承自 Object) |
| GetType() |
获取当前实例的 Type。Gets the Type of the current instance. (继承自 Object) |
| MemberwiseClone() |
创建当前 Object 的浅表副本。Creates a shallow copy of the current Object. (继承自 Object) |
| SaveAs(String) |
保存已上载文件的内容。Saves the contents of an uploaded file. |
| ToString() |
返回表示当前对象的字符串。Returns a string that represents the current object. (继承自 Object) |