// PathIsPathRooted.cpp : メイン プロジェクト ファイルです。 #include "stdafx.h" using namespace System; using namespace System::IO; void PathIsPathRooted() { String^ fileName = "C:\\MyFolder\\Homepage\\public_html\\Cprpr\\IsPathRootedPath\\IsPathRootedPath.txt"; String^ UncPath = "\\\\\\IsPathRootedPath\\NodeIsPathRootedPath.txt"; String^ relativePath = "mydir\\sudir\\"; bool result; result = Path::IsPathRooted(fileName); Console::WriteLine("IsPathRooted('{0}') returns {1}", fileName, result.ToString()); result = Path::IsPathRooted( UncPath ); Console::WriteLine("IsPathRooted('{0}') returns {1}", UncPath, result.ToString()); result = Path::IsPathRooted(relativePath); Console::WriteLine("IsPathRooted('{0}') returns {1}", relativePath, result.ToString()); } int main(array ^args) { PathIsPathRooted(); return 0; }