C# Uri UserInfo
Description
Uri UserInfo
gets the user name, password, or other user-specific
information associated with the specified URI.
Syntax
Uri.UserInfo
has the following syntax.
public string UserInfo { get; }
Example
The following example creates a Uri instance and writes the user information to the console.
//w w w. j av a2s . c o m
using System;
public class MainClass{
public static void Main(String[] argv){
Uri uriAddress = new Uri ("http://user:password@www.java2s.com/index.htm ");
Console.WriteLine(uriAddress.UserInfo);
Console.WriteLine("Fully Escaped {0}", uriAddress.UserEscaped ? "yes" : "no");
}
}
The code above generates the following result.