有没有一种方法可以检查给定路径是否为完整路径?现在我正在这样做:if(template.Contains(":\\"))//fullpathalreadygiven{}else//calculatethepathfromlocalassembly{}但是必须有更优雅的方法来检查这个吗? 最佳答案 尝试使用System.IO.Path.IsPathRooted?它还为绝对路径返回true。System.IO.Path.IsPathRooted(@"c:\foo");//trueSystem.IO.Path.IsPathRooted(@