本文整理匯總了C#中System.UrlInfo.ToString方法的典型用法代碼示例。如果您正苦於以下問題:C# UrlInfo.ToString方法的具體用法?C# UrlInfo.ToString怎麽用?C# UrlInfo.ToString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.UrlInfo
的用法示例。
在下文中一共展示了UrlInfo.ToString方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: test
public void test()
{
Uri uri = new Uri( "http://zhangsan:[email protected]/myapp/Photo/1984?title=eee#top" );
UrlInfo u = new UrlInfo( uri, "/myapp/", "myPathInfo" );
Console.WriteLine( "Scheme=>" + u.Scheme );
Console.WriteLine( "UserName=>" + u.UserName );
Console.WriteLine( "Password=>" + u.Password );
Console.WriteLine( "Host=>" + u.Host );
Console.WriteLine( "Port=>" + u.Port );
Console.WriteLine( "Path=>" + u.Path );
Console.WriteLine( "PathAndQuery=>" + u.PathAndQuery );
Console.WriteLine( "PathInfo=>" + u.PathInfo );
Console.WriteLine( "AppPath=>" + u.AppPath );
Console.WriteLine( "PathAndQueryWithouApp=>" + u.PathAndQueryWithouApp );
Console.WriteLine( "Query=>" + u.Query );
Console.WriteLine( "Fragment=>" + u.Fragment );
Console.WriteLine( "SiteUrl=>" + u.SiteUrl );
Console.WriteLine( "SiteAndAppPath=>" + u.SiteAndAppPath );
Console.WriteLine( "ToString=>" + u.ToString() );
/*
Scheme=>http
UserName=>zhangsan
Password=>123
Host=>www.wojilu.net
Port=>80
Path=>/myapp/Photo/1984
PathAndQuery=>/myapp/Photo/1984?title=eee
PathInfo=>myPathInfo
AppPath=>/myapp/
PathAndQueryWithouApp=>/Photo/1984?title=eee
Query=>?title=eee
Fragment=>#top
SiteUrl=>http://zhangsan:[email protected]
SiteAndAppPath=>http://zhangsan:[email protected]/myapp/
ToString=>http://zhangsan:[email protected]/myapp/Photo/1984?title=eee#top
*/
}