TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Windows 10: Code that uses 'os.StartsWith(“Windows 9”)'

41 点作者 thomasbachem超过 10 年前

11 条评论

gjulianm超过 10 年前
I don&#x27;t find this search reliable at all. There are a lot of completely unrelated results. I couldn&#x27;t find any related match on the 2.000+ Python results, for example. Same with C++. This is being publicized as &quot;proof&quot; of the rumor but it&#x27;s not representative at all.<p>The Windows C&#x2F;C++ API returns a structure with version numbers [1], same with the C# one [2]. Other languages just wrap the native C API call, GetVersionEx.<p>The most troubled framework is Java: because of some strange design decision, you can only get the version <i>as a string</i> (see [3]), and that makes impressively easy for programmers to screw up version checks. However, as other commenters have said, those apps could run on compatibility mode and Windows would solve the issue itself instead of completely changing an operating system&#x27;s name.<p>1: <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms724451%28v=vs.85%29.aspx" rel="nofollow">http:&#x2F;&#x2F;msdn.microsoft.com&#x2F;en-us&#x2F;library&#x2F;windows&#x2F;desktop&#x2F;ms72...</a> 2: <a href="http://msdn.microsoft.com/en-us/library/system.environment.osversion%28v=vs.110%29.aspx" rel="nofollow">http:&#x2F;&#x2F;msdn.microsoft.com&#x2F;en-us&#x2F;library&#x2F;system.environment.o...</a> 3: <a href="http://stackoverflow.com/questions/228477/how-do-i-programmatically-determine-operating-system-in-java" rel="nofollow">http:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;228477&#x2F;how-do-i-programma...</a>
评论 #8409848 未加载
评论 #8409843 未加载
hk__2超过 10 年前
Previous discussion: <a href="https://news.ycombinator.com/item?id=8397664" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=8397664</a>
pavlov超过 10 年前
My theory about the &quot;Windows 10&quot; name is that there is an intermediate Windows Phone release coming in early 2015, and they&#x27;ve decided to call that Windows Phone 9. Hence the unified release will be version 10.
bcj超过 10 年前
I ran into some code a few days ago that wouldn&#x27;t install because it was checking OS X version as a string and &#x27;10.10&#x27; &lt; &#x27;10.5&#x27;. Bad code will always find a way
评论 #8409818 未加载
csandreasen超过 10 年前
Apparently one of the perks to not calling it Windows 9 is that Microsoft doesn&#x27;t have to deal with poorly written OS detection code that searches for &quot;Windows 9&quot; in expectation of it matching &quot;Windows 95&quot; or &quot;Windows 98&quot;.
snarfy超过 10 年前
They could have just ran those apps in compatibility mode, which returns different values for all the GetWindowsVersion calls.<p>Or they could rename the entire OS.
评论 #8409457 未加载
评论 #8409535 未加载
more_original超过 10 年前
CP&#x2F;M&#x2F;3.1 (Pentium (like 386); Intel AMD) DOS 6.0 Windows&#x2F;6.4 (NT, like Mac OS X) Windows&#x2F;95 Windows&#x2F;10
DanBC超过 10 年前
So, when they get to Windows 19 do they need to skip to 21 to avoid all the 2000 checks?
评论 #8409771 未加载
outworlder超过 10 年前
There are no good reasons to check for an OS version anyway. Checking for the platform, ok. Not the version. That can be handled with feature detection.
评论 #8409635 未加载
评论 #8409773 未加载
评论 #8409619 未加载
serve_yay超过 10 年前
Ahhh, come on already with this one. Let it die.
cssandjs超过 10 年前
Oh my!<p>So that&#x27;s why they went with 10 - it makes sense now.