Uri.DnsSafeHost プロパティ
アセンブリ: System (system.dll 内)
構文
例外
解説
使用例
文字列から Uri インスタンスを作成する例を次に示します。この例では、Host から返された値 (URI で指定したホスト名またはアドレスを返す ) と、DnsSafeHost から返された値 (DNS の解決に安全に使用できるアドレスを返す) の相違を表しています。
' Create new Uri using a string address. Dim address As New Uri("http://[fe80::200:39ff:fe36:1a2d%4]/temp/example.htm") ' Make the address DNS safe. ' The following outputs "[fe80::200:39ff:fe36:1a2d]". Console.WriteLine(address.Host) ' The following outputs "fe80::200:39ff:fe36:1a2d%4". Console.WriteLine(address.DnsSafeHost) End Sub 'SampleDNSSafeHost
// Create new Uri using a string address. Uri address = new Uri("http://[fe80::200:39ff:fe36:1a2d%4]/temp/example.htm"); // Make the address DNS safe. // The following outputs "[fe80::200:39ff:fe36:1a2d]". Console.WriteLine(address.Host); // The following outputs "fe80::200:39ff:fe36:1a2d%4". Console.WriteLine(address.DnsSafeHost);
Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
参照
- Uri.DnsSafeHost プロパティのページへのリンク