UriParser.Register(UriParser, String, Int32) 方法

定义

将方案和端口号与 UriParser 关联。Associates a scheme and port number with a UriParser.

public:
 static void Register(UriParser ^ uriParser, System::String ^ schemeName, int defaultPort);
public static void Register (UriParser uriParser, string schemeName, int defaultPort);
static member Register : UriParser * string * int -> unit

参数

uriParser
UriParser

要注册的 URI 分析器。The URI parser to register.

schemeName
String

与此分析器关联的方案的名称。The name of the scheme that is associated with this parser.

defaultPort
Int32

指定方案的默认端口号。The default port number for the specified scheme.

异常

uriParser 参数为 nulluriParser parameter is null - 或 --or- schemeName 参数为 null。schemeName parameter is null.

schemeName 参数无效schemeName parameter is not valid -or- defaultPort 参数无效。defaultPort parameter is not valid. defaultPort 参数小于 -1 或大于 65,534。The defaultPort parameter is less than -1 or greater than 65,534.

注解

如果 defaultPort 参数设置为-1,则 @no__t 的方法将不会为端口号注册默认值。If the defaultPort parameter is set to -1, the Register method registers no default value for the port number.

适用于