Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有很多文件,其中一些是 HTML,另一些是 XML。如果提供了文件的路径,我怎么能可靠地说,它是 XML 而不是 HTML,反之亦然。最好使用枚举内置 c# 语言,而不是通过编写 Path.GetExtension(filePath).Equals(".xml")