Windows文件名中的半冒号? [英] semi colons in Windows filenames?
问题描述
我的一位用户问为什么我的应用程序不支持文件名中的分号.我逐步执行了代码,似乎Windows函数GetOpenFileName会截断任何包含分号的文件名.例如一个; two.wav"->一个".
One of my users asked why my app does not support semi-colons in filenames. I stepped through my code, seems Windows function GetOpenFileName truncates any filename containing a semi-colon. e.g. "one;two.wav" -> "one".
Microsoft说不允许使用冒号,但不要提及分号...
Microsoft says colons are not allowed, but don't mention semi-colons...
http://msdn.microsoft.com/en -us/library/aa365247(VS.85).aspx
他们合法吗?
..以及如何使GetOpenFileName()与文件名中的分号一起使用?
..and how to GetOpenFileName() to work with semi-colons in filename?
OH !,很奇怪-文件名正确,但左侧滚动"除外.因此,"one; two.wav"看起来就像"two.wav",直到我单击它并按左箭头(然后就可以了).因此,这并不是错误,只是怪异的行为.
OH!, Weird - Filename is correct, except 'scrolled' off to the left. So "one;two.wav" looks like "two.wav" until I click it and press left-arrow (then it's fine). So it's not a bug as such, only weird behaviour.
推荐答案
我能够在Win7系统上的文件名中添加分号.注意代码,可能是您的代码或第三方代码,它们用意外的字符(最显着的空格)来做奇怪的事情.
I'm able to add semicolons to filenames on my Win7 system. Watch for code, probably yours or third-party code, that does strange things with unexpected characters (most notably spaces).
这篇关于Windows文件名中的半冒号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!