ellapt

T14.12.ParseURL

Feb 3rd, 2013
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. using System;
  2. using System.Web;
  3. class ParseURL
  4. {
  5. static void Main()
  6. {
  7. Console.WriteLine("Write a program that parses an URL address\n");
  8. Uri locator = new Uri("http://www.devbg.org/forum/index.php");
  9. Console.WriteLine("\nURL: http://www.devbg.org/forum/index.php\n");
  10. Console.WriteLine("Protocol name = {0}", locator.Scheme);
  11. Console.WriteLine("Server name = {0}", locator.Host);
  12. Console.WriteLine("Resource name = {0}\n", locator.AbsolutePath);
  13. }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment