MimeTextMatch.Capture 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定值,指出群組中的 MimeTextMatch 以零起始的索引。
public:
property int Capture { int get(); void set(int value); };
public int Capture { get; set; }
member this.Capture : int with get, set
Public Property Capture As Integer
屬性值
32 位元帶正負號的整數。 預設值為 0,指出 MimeTextMatch 是群組中的第一個執行個體。
例外狀況
屬性值為負數。
範例
// Create an InputBinding.
InputBinding^ myInputBinding = gcnew InputBinding;
MimeTextBinding^ myMimeTextBinding = gcnew MimeTextBinding;
MimeTextMatchCollection^ myMimeTextMatchCollection1 = gcnew MimeTextMatchCollection;
array<MimeTextMatch^>^myMimeTextMatch = gcnew array<MimeTextMatch^>(3);
myMimeTextMatchCollection1 = myMimeTextBinding->Matches;
// Intialize the MimeTextMatch.
for ( myInt = 0; myInt < 3; myInt++ )
{
// Get a new MimeTextMatch.
myMimeTextMatch[ myInt ] = gcnew MimeTextMatch;
// Assign values to properties of the MimeTextMatch.
myMimeTextMatch[ myInt ]->Name = String::Format( "Title{0}", Convert::ToString( myInt ) );
myMimeTextMatch[ myInt ]->Type = "*/*";
myMimeTextMatch[ myInt ]->Pattern = "TITLE>(.*?)<";
myMimeTextMatch[ myInt ]->IgnoreCase = true;
myMimeTextMatch[ myInt ]->Capture = 2;
myMimeTextMatch[ myInt ]->Group = 2;
if ( myInt != 0 )
{
// Assign the Repeats property if the index is not 0.
myMimeTextMatch[ myInt ]->Repeats = 2;
}
else
{
// Assign the RepeatsString property if the index is 0.
myMimeTextMatch[ myInt ]->RepeatsString = "4";
}
myMimeTextMatchCollection1->Add( myMimeTextMatch[ myInt ] );
}
// Create an InputBinding.
InputBinding myInputBinding = new InputBinding();
MimeTextBinding myMimeTextBinding = new MimeTextBinding();
MimeTextMatchCollection myMimeTextMatchCollection1 =
new MimeTextMatchCollection();
MimeTextMatch[] myMimeTextMatch = new MimeTextMatch[3];
myMimeTextMatchCollection1 = myMimeTextBinding.Matches;
// Intialize the MimeTextMatch.
for( myInt = 0 ; myInt < 3 ; myInt++ )
{
// Get a new MimeTextMatch.
myMimeTextMatch[ myInt ] = new MimeTextMatch();
// Assign values to properties of the MimeTextMatch.
myMimeTextMatch[ myInt ].Name = "Title" + Convert.ToString( myInt );
myMimeTextMatch[ myInt ].Type = "*/*";
myMimeTextMatch[ myInt ].Pattern = "TITLE>(.*?)<";
myMimeTextMatch[ myInt ].IgnoreCase = true;
myMimeTextMatch[ myInt ].Capture = 2;
myMimeTextMatch[ myInt ].Group = 2;
if( myInt != 0 )
{
// Assign the Repeats property if the index is not 0.
myMimeTextMatch[ myInt ].Repeats = 2;
}
else
{
// Assign the RepeatsString property if the index is 0.
myMimeTextMatch[ myInt ].RepeatsString = "4";
}
// Add the MimeTextMatch to the collection.
myMimeTextMatchCollection1.Add( myMimeTextMatch[ myInt ] );
}
' Create an InputBinding.
Dim myInputBinding As New InputBinding()
Dim myMimeTextBinding As New MimeTextBinding()
Dim myMimeTextMatchCollection1 As New MimeTextMatchCollection()
Dim myMimeTextMatch(2) As MimeTextMatch
myMimeTextMatchCollection1 = myMimeTextBinding.Matches
' Intialize the MimeTextMatch.
For myInt = 0 To 2
' Get a new MimeTextMatch.
myMimeTextMatch(myInt) = New MimeTextMatch()
' Assign values to properties of the MimeTextMatch.
myMimeTextMatch(myInt).Name = "Title" + Convert.ToString(myInt)
myMimeTextMatch(myInt).Type = "*/*"
myMimeTextMatch(myInt).Pattern = "TITLE>(.*?)<"
myMimeTextMatch(myInt).IgnoreCase = True
myMimeTextMatch(myInt).Capture = 2
myMimeTextMatch(myInt).Group = 2
If myInt <> 0 Then
' Assign the Repeats property if the index is not 0.
myMimeTextMatch(myInt).Repeats = 2
Else
' Assign the RepeatsString property if the index is 0.
myMimeTextMatch(myInt).RepeatsString = "4"
End If
' Add 'MimeTextMatch' instance to collection.
myMimeTextMatchCollection1.Add(myMimeTextMatch(myInt))
Next myInt
備註
如需詳細資訊,請參閱 Group 和 Matches 屬性。