Uri
In this chapter you will learn:
Create Uri
using System; /*from j av a2 s .c o m*/
using System.Net;
class MainClass {
public static void Main() {
Uri sample = new Uri("http://www.yoursite.com/somefile.txt?SomeQuery");
Console.WriteLine("Host: " + sample.Host);
Console.WriteLine("Port: " + sample.Port);
Console.WriteLine("Scheme: " + sample.Scheme);
Console.WriteLine("Local Path: " + sample.LocalPath);
Console.WriteLine("Query: " + sample.Query);
Console.WriteLine("Path and query: " + sample.PathAndQuery);
}
}
The code above generates the following result.
Next chapter...
What you will learn in the next chapter:
Home » C# Tutorial » Network