擅长:python、mysql、java
<p>尝试<code>Path.Combine</code>没有任何内容的路径,或者<code>Path.ChangeExtension</code>它到<code>Path.GetExtension</code>。也许这些无用的程序中的一个(或另一个)正常化了。在</p>
<p>除此之外:<code>Path</code>类<a href="http://msdn.microsoft.com/de-de/library/system.io.path.aspx" rel="nofollow">doesn’t</a>似乎包含函数。在</p>
<p>或者,你可以自己编程。来自Python文档:</p>
<pre><code>Normalize a pathname. This collapses redundant separators and up-level references
so that A//B, A/B/, A/./B and A/foo/../B all become A/B.
It does not normalize the case (use normcase() for that). On Windows, it converts
forward slashes to backward slashes. It should be understood that this may change
the meaning of the path if it contains symbolic links!
</code></pre>