HttpFileCollectionBase 类

定义

用作一些类的基类,这些类提供对客户端已上载的文件的访问。Serves as the base class for classes that provide access to files that were uploaded by a client.

public ref class HttpFileCollectionBase abstract : System::Collections::Specialized::NameObjectCollectionBase, System::Collections::ICollection
public abstract class HttpFileCollectionBase : System.Collections.Specialized.NameObjectCollectionBase, System.Collections.ICollection
type HttpFileCollectionBase = class
    inherit NameObjectCollectionBase
    interface ICollection
    interface IEnumerable
Public MustInherit Class HttpFileCollectionBase
Inherits NameObjectCollectionBase
Implements ICollection
继承
HttpFileCollectionBase
派生
实现

注解

类是一个抽象类, 它包含与HttpFileCollection类相同的成员。 HttpFileCollectionBaseThe HttpFileCollectionBase class is an abstract class that contains the same members as the HttpFileCollection class. 利用类, 您可以创建HttpFileCollection类似于类的派生类, 但可以自定义该派生类并在 ASP.NET 管道之外工作。 HttpFileCollectionBaseThe HttpFileCollectionBase class lets you create derived classes that are like the HttpFileCollection class, but that you can customize and that work outside the ASP.NET pipeline. 执行单元测试时, 通常使用派生类来实现具有自定义行为的成员, 以满足你要测试的方案。When you perform unit testing, you typically use a derived class to implement members with customized behavior that fulfills the scenario that you are testing.

HttpFileCollectionWrapper 类是从 HttpFileCollectionBase 类派生的。The HttpFileCollectionWrapper class derives from the HttpFileCollectionBase class. 类用作HttpFileCollection类的包装。 HttpFileCollectionWrapperThe HttpFileCollectionWrapper class serves as a wrapper for the HttpFileCollection class. 在运行时, 通常使用HttpFileCollectionWrapper类的实例来调用HttpFileCollection对象的成员。At run time, you typically use an instance of the HttpFileCollectionWrapper class to call members of the HttpFileCollection object.

构造函数

HttpFileCollectionBase()

初始化该类供继承的类实例使用。Initializes the class for use by an inherited class instance. 此构造函数只能由继承的类调用。This constructor can only be called by an inherited class.

属性

AllKeys

在派生类中重写时,获取一个数组,它包含集合中所有已发布的文件对象的键(名称)。When overridden in a derived class, gets an array that contains the keys (names) of all posted file objects in the collection.

Count

在派生类中重写时,获取集合中已发布文件对象的数目。When overridden in a derived class, gets the number of posted file objects in the collection.

IsReadOnly

获取或设置一个值,通过该值指示 NameObjectCollectionBase 实例是否为只读的。Gets or sets a value indicating whether the NameObjectCollectionBase instance is read-only.

(继承自 NameObjectCollectionBase)
IsSynchronized

当在派生类中重写时,获取一个值,该值指示对集合的访问是否是线程安全的。When overridden in a derived class, gets a value that indicates whether access to the collection is thread-safe.

Item[Int32]

当在派生类中重写时,获取指定索引处的已发布文件对象。When overridden in a derived class, gets the posted file object at the specified index.

Item[String]

当在派生类中重写时,获取集合中具有指定名称的已发布文件对象。When overridden in a derived class, gets the posted file object that has the specified name from the collection.

Keys

获取 NameObjectCollectionBase.KeysCollection 实例,该实例包含 NameObjectCollectionBase 实例中的所有键。Gets a NameObjectCollectionBase.KeysCollection instance that contains all the keys in the NameObjectCollectionBase instance.

(继承自 NameObjectCollectionBase)
SyncRoot

当在派生类中重写时,获取一个对象,该对象可用于同步对集合的访问。When overridden in a derived class, gets an object that can be used to synchronize access to the collection.

方法

BaseAdd(String, Object)

将具有指定键和值的项添加到 NameObjectCollectionBase 实例中。Adds an entry with the specified key and value into the NameObjectCollectionBase instance.

(继承自 NameObjectCollectionBase)
BaseClear()

移除 NameObjectCollectionBase 实例中的所有项。Removes all entries from the NameObjectCollectionBase instance.

(继承自 NameObjectCollectionBase)
BaseGet(Int32)

获取 NameObjectCollectionBase 实例的指定索引处的项值。Gets the value of the entry at the specified index of the NameObjectCollectionBase instance.

(继承自 NameObjectCollectionBase)
BaseGet(String)

获取 NameObjectCollectionBase 实例中第一个具有指定键的项值。Gets the value of the first entry with the specified key from the NameObjectCollectionBase instance.

(继承自 NameObjectCollectionBase)
BaseGetAllKeys()

返回 String 数组,该数组包含 NameObjectCollectionBase 实例中的所有键。Returns a String array that contains all the keys in the NameObjectCollectionBase instance.

(继承自 NameObjectCollectionBase)
BaseGetAllValues()

返回 Object 数组,该数组包含 NameObjectCollectionBase 实例中的所有值。Returns an Object array that contains all the values in the NameObjectCollectionBase instance.

(继承自 NameObjectCollectionBase)
BaseGetAllValues(Type)

返回指定类型的数组,该数组包含 NameObjectCollectionBase 实例中的所有值。Returns an array of the specified type that contains all the values in the NameObjectCollectionBase instance.

(继承自 NameObjectCollectionBase)
BaseGetKey(Int32)

获取 NameObjectCollectionBase 实例的指定索引处的项键。Gets the key of the entry at the specified index of the NameObjectCollectionBase instance.

(继承自 NameObjectCollectionBase)
BaseHasKeys()

获取一个值,通过该值指示 NameObjectCollectionBase 实例是否包含键不为 null 的项。Gets a value indicating whether the NameObjectCollectionBase instance contains entries whose keys are not null.

(继承自 NameObjectCollectionBase)
BaseRemove(String)

移除 NameObjectCollectionBase 实例中具有指定键的项。Removes the entries with the specified key from the NameObjectCollectionBase instance.

(继承自 NameObjectCollectionBase)
BaseRemoveAt(Int32)

移除 NameObjectCollectionBase 实例的指定索引处的项。Removes the entry at the specified index of the NameObjectCollectionBase instance.

(继承自 NameObjectCollectionBase)
BaseSet(Int32, Object)

设置 NameObjectCollectionBase 实例的指定索引处的项值。Sets the value of the entry at the specified index of the NameObjectCollectionBase instance.

(继承自 NameObjectCollectionBase)
BaseSet(String, Object)

NameObjectCollectionBase 实例中第一个具有指定键的项设置值(如果有这样的项);否则将具有指定键和值的项添加到 NameObjectCollectionBase 实例中。Sets the value of the first entry with the specified key in the NameObjectCollectionBase instance, if found; otherwise, adds an entry with the specified key and value into the NameObjectCollectionBase instance.

(继承自 NameObjectCollectionBase)
CopyTo(Array, Int32)

在派生类中重写时,从数组中指定的索引开始,将集合的元素复制到该数组。When overridden in a derived class, copies the elements of the collection to an array, starting at the specified index in the array.

Equals(Object)

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

(继承自 Object)
Get(Int32)

当在派生类中重写时,返回指定索引处的已发布文件对象。When overridden in a derived class, returns the posted file object at the specified index.

Get(String)

当在派生类中重写时,返回集合中具有指定名称的已发布文件对象。When overridden in a derived class, returns the posted file object that has the specified name from the collection.

GetEnumerator()

当在派生类中重写时,返回可用于循环访问集合的枚举数。When overridden in a derived class, returns an enumerator that can be used to iterate through the collection.

GetHashCode()

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

(继承自 Object)
GetKey(Int32)

当在派生类中重写时,返回指定索引处的已发布文件对象的名称。When overridden in a derived class, returns the name of the posted file object at the specified index.

GetMultiple(String)

在派生类中实现时,返回与指定名称匹配的所有文件。When implemented in a derived class, returns all files that match the specified name.

GetObjectData(SerializationInfo, StreamingContext)

实现 ISerializable 接口,并返回序列化 NameObjectCollectionBase 实例所需的数据。Implements the ISerializable interface and returns the data needed to serialize the NameObjectCollectionBase instance.

(继承自 NameObjectCollectionBase)
GetType()

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

(继承自 Object)
MemberwiseClone()

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

(继承自 Object)
OnDeserialization(Object)

实现 ISerializable 接口,并在完成反序列化之后引发反序列化事件。Implements the ISerializable interface and raises the deserialization event when the deserialization is complete.

(继承自 NameObjectCollectionBase)
ToString()

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

(继承自 Object)

显式界面实现

ICollection.CopyTo(Array, Int32)

从目标数组的指定索引处开始将整个 NameObjectCollectionBase 复制到兼容的一维 ArrayCopies the entire NameObjectCollectionBase to a compatible one-dimensional Array, starting at the specified index of the target array.

(继承自 NameObjectCollectionBase)
ICollection.IsSynchronized

获取一个值,该值指示对 NameObjectCollectionBase 对象的访问是否同步(线程安全)。Gets a value indicating whether access to the NameObjectCollectionBase object is synchronized (thread safe).

(继承自 NameObjectCollectionBase)
ICollection.SyncRoot

获取一个对象,该对象可用于同步对 NameObjectCollectionBase 对象的访问。Gets an object that can be used to synchronize access to the NameObjectCollectionBase object.

(继承自 NameObjectCollectionBase)

扩展方法

Cast<TResult>(IEnumerable)

IEnumerable 的元素强制转换为指定的类型。Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable)

根据指定类型筛选 IEnumerable 的元素。Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable)

启用查询的并行化。Enables parallelization of a query.

AsQueryable(IEnumerable)

IEnumerable 转换为 IQueryableConverts an IEnumerable to an IQueryable.

适用于