Definition at line 303 of file UriBuilder.cs.
304 {
306 {
308 }
309 Span<char> initialBuffer = stackalloc char[512];
313 if (scheme.Length != 0)
314 {
315 UriParser syntax = UriParser.GetSyntax(scheme);
316 string s = ((syntax !=
null) ? ((syntax.InFact(UriSyntaxFlags.MustHaveAuthority) || (host.Length != 0 && syntax.NotAny(UriSyntaxFlags.MailToLikeUri) && syntax.InFact(UriSyntaxFlags.OptionalAuthority))) ? System.Uri.SchemeDelimiter :
":") : ((host.
Length == 0) ?
":" :
System.Uri.SchemeDelimiter));
317 valueStringBuilder.
Append(scheme);
319 }
321 if (userName.Length != 0)
322 {
323 valueStringBuilder.
Append(userName);
325 if (password.Length != 0)
326 {
327 valueStringBuilder.
Append(
':');
328 valueStringBuilder.
Append(password);
329 }
330 valueStringBuilder.
Append(
'@');
331 }
332 if (host.Length != 0)
333 {
334 valueStringBuilder.
Append(host);
336 {
337 valueStringBuilder.
Append(
':');
338 int charsWritten;
339 bool flag =
_port.TryFormat(valueStringBuilder.
AppendSpan(5), out charsWritten);
340 valueStringBuilder.Length -= 5 - charsWritten;
341 }
342 }
344 if (path.Length != 0)
345 {
346 if (!path.StartsWith('/') && host.Length != 0)
347 {
348 valueStringBuilder.
Append(
'/');
349 }
350 valueStringBuilder.
Append(path);
351 }
354 return valueStringBuilder.
ToString();
355 }
static string net_uri_BadUserPassword
override string ToString()
Span< char > AppendSpan(int length)
References System.UriBuilder._port, System.Text.ValueStringBuilder.Append(), System.Text.ValueStringBuilder.AppendSpan(), System.UriBuilder.Fragment, System.UriParser.GetSyntax(), System.UriBuilder.Host, System.UriParser.InFact(), System.SR.net_uri_BadUserPassword, System.UriParser.NotAny(), System.UriBuilder.Password, System.UriBuilder.Path, System.UriBuilder.Query, System.s, System.UriBuilder.Scheme, System.Uri.SchemeDelimiter, System.Text.ValueStringBuilder.ToString(), and System.UriBuilder.UserName.