UriBuilder.ToString 方法
定义
返回指定 UriBuilder 实例的显示字符串。Returns the display string for the specified UriBuilder instance.
public:
override System::String ^ ToString();
public override string ToString ();
override this.ToString : unit -> string
Public Overrides Function ToString () As String
返回
包含 UriBuilder 非转义显示字符串的字符串。The string that contains the unescaped display string of the UriBuilder.
例外
注解
Port如果设置了属性,或在使用接受端口号参数的方法构造时指定了端口号参数,则显示字符串将包含属性值,如果该属性值 Port UriBuilder UriBuilder Port 设置为值-1 以指示默认端口,则为。The display string contains the Port property value if the Port property was set or the port was specified when the UriBuilder was constructed using of the UriBuilder methods that accept a port number parameter except for the case when the Port.property value was set to a value of -1 to indicate the default port.
Port如果 Port 未设置属性,并且构造时未指定端口,则显示字符串不包含属性值 UriBuilder 。The display string does not contain the Port property value if the Port property was not set and a port was not specified when the UriBuilder was constructed. Port如果 Port 构造函数的属性或端口号设置为值-1,则显示字符串也不包含属性值。The display string also does not contain the Port property value if the Port property or port number for the constructor was set to a value of -1.