Gets a bool value indicating whether the host information of the current instance is the current computer.
true if the host of the current instance is the reserved hostname "localhost" or the loop-back IP address (127.0.0.1); otherwise, false.
This property is read-only.
The following example demonstrates the Uri.IsLoopback property.
C# Example
using System; public class UriTest { public static void Main() { Uri myUri = new Uri("http://127.0.0.1/index.htm", true); Console.WriteLine("{0} is loopback? {1}", myUri.ToString(), myUri.IsLoopback); myUri = new Uri("http://localhost/index.htm", true); Console.WriteLine("{0} is loopback? {1}", myUri.ToString(), myUri.IsLoopback); } }The output is
http://127.0.0.1/index.htm is loopback? True
http://localhost/index.htm is loopback? True
Namespace: System
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0