Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27513

Having Trouble with a Console URI code

$
0
0
I found a wonderful site that gives various code samples that you can test out and try.
This was one that was interesting to me.
Code:

Imports System.IO
Imports System.Net
Imports System.Text

public class MainClass
  Shared Sub Main()

    Console.WriteLine(Uri.CheckHostName("www.google.com"))

  End Sub
End Class

For some reason it does not seem to work.
I tried adding
Console.ReadLine()
Console.Write("Press enter to continue...")
but that only gives me the number 2 and when I press enter I briefly see "Press enter to continue..." then the program closes.
First off I thought that the idea of this code was to check whether the specified host name is a valid DNS name.

It does not seem to do anything of the sort.

Viewing all articles
Browse latest Browse all 27513

Trending Articles