共用方式為


HostString.MatchesAny(StringSegment, IList<StringSegment>) 方法

定義

比對主機標頭值的主機部分與模式清單。 只要模式使用相同的格式,主機可能是編碼的 punycode 或解碼 Unicode 格式。

public:
 static bool MatchesAny(Microsoft::Extensions::Primitives::StringSegment value, System::Collections::Generic::IList<Microsoft::Extensions::Primitives::StringSegment> ^ patterns);
public static bool MatchesAny (Microsoft.Extensions.Primitives.StringSegment value, System.Collections.Generic.IList<Microsoft.Extensions.Primitives.StringSegment> patterns);
static member MatchesAny : Microsoft.Extensions.Primitives.StringSegment * System.Collections.Generic.IList<Microsoft.Extensions.Primitives.StringSegment> -> bool
Public Shared Function MatchesAny (value As StringSegment, patterns As IList(Of StringSegment)) As Boolean

參數

value
StringSegment

具有或不含埠的主機標頭值。

patterns
IList<StringSegment>

一組要比對的模式,不含埠。

傳回

true 如果 value 符合任何模式,則為 。

備註

會忽略指定值上的埠。 模式不應該有埠。 模式可能完全相符,例如 「example.com」、符合所有主機的最上層萬用字元 「*」,或是符合 「example.com abc.example.com:443」 但不符合 「example.com:443」 的子域萬用字元。 比對不區分大小寫。

適用於