ParserErrorCollection.CopyTo メソッド
アセンブリ: System.Web (system.web.dll 内)
構文
Dim instance As ParserErrorCollection Dim array As ParserError() Dim index As Integer instance.CopyTo(array, index)
CopyTo メソッドを使用して、コレクション内の ParserError オブジェクト (それらに格納される項目の参照を含む) を、指定したインデックスを開始位置として、互換性がある配列にコピーします。これは、Sort メソッドを使用して、コレクション内の ParserError オブジェクトを並べ替える場合に便利です。上記の処理を実現するには、次の操作を実行します。
ParserErrorCollection オブジェクトの内容を指定した ParserError 配列にコピーする方法を次のコード例に示します。
' Copy the contents of the collection to a ' compatible array, starting at index 0 of the ' destination array. Dim errorsToSort(5) As ParserError collection.CopyTo(errorsToSort, 0)
// Copy the contents of the collection to a // compatible array, starting at index 0 of the // destination array. ParserError[] errorsToSort = new ParserError[5]; collection.CopyTo(errorsToSort, 0);
Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
参照
- ParserErrorCollection.CopyTo メソッドのページへのリンク