【发布时间】:2009-11-04 10:53:36
【问题描述】:
正斜杠“/”的 .net 命名空间常量是什么
所以而不是:
somePath + "/" + someFile
我能做到:
somePath + .net.namespace.forwardslash + someFile
差别不大,但可能更整洁?
【问题讨论】:
标签: c# .net namespaces
正斜杠“/”的 .net 命名空间常量是什么
所以而不是:
somePath + "/" + someFile
我能做到:
somePath + .net.namespace.forwardslash + someFile
差别不大,但可能更整洁?
【问题讨论】:
标签: c# .net namespaces
System.IO.Path.DirectorySeparatorChar 是我想的你想要的。
顺便说一句,更明智的做法是使用System.IO.Path.Combine(somePath,someFile)。
【讨论】:
如果您需要,只需使用正斜杠,但如果您尝试组合文件名和路径,只需使用 System.IO.Path.Combine()。
【讨论】:
你应该选择System.IO.Path.DirectorySeparatorChar
【讨论】:
【讨论】: