Uri.IsLoopback プロパティ
アセンブリ: System (system.dll 内)
構文
例外
解説このインスタンスの作成時に指定された URI が 127.0.0.1、loopback、または localhost の場合、または URI でホスト情報が指定されなかった場合 (file:///c:Dir/file.txt など) は、IsLoopback から true が返ります。その他のすべての URI からは、false が返ります。
使用例Uri インスタンスを作成し、このインスタンスがローカル ホストを参照しているかどうかを判断する例を次に示します。
Dim uriAddress2 As New Uri("file://server/filename.ext") Console.WriteLine(uriAddress2.LocalPath) Console.WriteLine("Uri {0} a UNC path", IIf(uriAddress2.IsUnc, "is", "is not")) 'TODO: For performance reasons this should be changed to nested IF statements Console.WriteLine("Uri {0} a local host", IIf(uriAddress2.IsLoopback, "is", "is not")) 'TODO: For performance reasons this should be changed to nested IF statements Console.WriteLine("Uri {0} a file", IIf(uriAddress2.IsFile, "is", "is not")) 'TODO: For performance reasons this should be changed to nested IF statements End Sub 'GetParts
Uri uriAddress2 = new Uri("file://server/filename.ext"); Console.WriteLine(uriAddress2.LocalPath); Console.WriteLine("Uri {0} a UNC path", uriAddress2.IsUnc ? "is" : "is not"); Console.WriteLine("Uri {0} a local host", uriAddress2.IsLoopback ? "is" : "is not"); Console.WriteLine("Uri {0} a file", uriAddress2.IsFile ? "is" : "is not");
プラットフォーム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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
バージョン情報
参照Weblioに収録されているすべての辞書からUri.IsLoopback プロパティを検索する場合は、下記のリンクをクリックしてください。
全ての辞書からUri.IsLoopback プロパティ
を検索
- Uri.IsLoopback プロパティのページへのリンク