using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net;
namespace ConsoleApplication_Internet_2
{
class Program
{
static void Main(string[] args)
{
//Dos的命令列會以&符號做命令分隔字元,因此若要以指令模式下,網址中的&之後會被視為是下一個指令
System.Uri URL=new System.Uri("http://findbook.tw/search?keyword_type=keyword&t=xxx");
//System.Uri 類別之屬性
Console.WriteLine("Absolute Path: " + URL.AbsolutePath);
Console.WriteLine("Absolute Uri : " + URL.AbsoluteUri);
Console.WriteLine("Host : " + URL.Host);
Console.WriteLine("Port : " + URL.Port);
Console.WriteLine("LocalPath : " + URL.LocalPath);
Console.WriteLine("IsDefaultPort: " + URL.IsDefaultPort);
Console.WriteLine("IsFile : " + URL.IsFile);
Console.WriteLine("PathAndQuery : " + URL.PathAndQuery);
Console.WriteLine("Query : " + URL.Query);
Console.WriteLine("Scheme : " + URL.Scheme);
Console.WriteLine("UserEscaped : " + URL.UserEscaped);
Console.WriteLine("UserInfo : " + URL.UserInfo);
Console.Read();
}
}
}
沒有留言:
張貼留言