RoleProviderCollection.CopyTo(RoleProvider[], Int32) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Copies the role provider collection to a one-dimensional array.
public:
void CopyTo(cli::array <System::Web::Security::RoleProvider ^> ^ array, int index);
public void CopyTo (System.Web.Security.RoleProvider[] array, int index);
override this.CopyTo : System.Web.Security.RoleProvider[] * int -> unit
Public Sub CopyTo (array As RoleProvider(), index As Integer)
Parameters
- array
- RoleProvider[]
A one-dimensional Array that is the destination of the elements copied from the RoleProviderCollection. The array must have zero-based indexing.
- index
- Int32
The zero-based index in array
at which copying begins.
Examples
The following code example uses the CopyTo method to copy the contents of a RoleProviderCollection to an array of RoleProvider objects.
RoleProviderCollection providers = Roles.Providers;
RoleProvider[] copiedProviders = new RoleProvider[providers.Count];
providers.CopyTo(copiedProviders, 0);
Dim providers As RoleProviderCollection = Roles.Providers
Dim copiedProviders(providers.Count) As RoleProvider
providers.CopyTo(copiedProviders, 0)
Remarks
This method uses ArrayList.CopyTo to copy role provider objects to the specified array.
Applies to
See also
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈