Uri.IsFile プロパティ
アセンブリ: System (system.dll 内)
構文
解説
使用例Uri インスタンスを作成し、このインスタンスがファイル 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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
バージョン情報
参照- Uri.IsFile プロパティのページへのリンク