本文介绍了区分服务器操作系统和工作站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 如何以编程方式告诉应用程序是在服务器上运行还是在工作站上运行,例如: windows 2000服务器或Windows 2000专业版 例子? 谢谢, DennisHow can I tell programmatically if an application is running on a server orworkstation, e.g. windows 2000 server or windows 2000 professional forexample?Thanks,Dennis推荐答案 使用OSVERSIONINFOEX结构调用GetVersionEx,然后检查是否 wProductType member设置了VER_NT_SERVER或VER_NT_WORKSTATION 标志。请参阅 http://support.microsoft.com/ ?kbid = 304721 http://msdn.microsoft.com/library/en...tversionex.asp 另一种方法是使用WMI,Win32_OperatingSystem类及其 ProductType属性。 Mattias - Mattias Sj?gren [ MVP] mattias @ mvps.org http://www.msjogren.net/ dotnet / | http://www.dotnetinterop.com 请回复到新闻组。Call GetVersionEx with the OSVERSIONINFOEX struct, then check whetherthe wProductType member has the VER_NT_SERVER or VER_NT_WORKSTATIONflag set. See http://support.microsoft.com/?kbid=304721 http://msdn.microsoft.com/library/en...tversionex.aspAn alternative is to use WMI, the Win32_OperatingSystem class and itsProductType property.Mattias--Mattias Sj?gren [MVP] mattias @ mvps.org http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.comPlease reply only to the newsgroup. 这篇关于区分服务器操作系统和工作站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-01 03:16