1 Star 0 Fork 261

村西康师傅/project_20595785

forked from mktime/python-learn 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
downloads
qsbk
.gitignore
FSM.py
LICENSE
README.md
SSEncrypt.module
arch-install.md
auto_build.py
baidu_ocr.py
balance_config.ini
balance_query.py
balance_query_batch.txt
bencode.py
bloom_1.cpp
bloom_1.py
bloom_2.py
contacts.xml
crack_test.py
crack_wifi.txt
data-structure.py
delicious.md
delicious.xml
demo.c
dht_client.py
dou2.py
download.py
egcd.py
export_delicious.sh
fetchurl.py
find_repeat.py
findbig.py
flv2mp4.py
get_bookmarks.py
get_version.py
howto_terminate_thread.py
http_proxy.py
i3_config
import_ess_picture.py
ipfind.py
joseph-cycle.py
learn-class.py
learn-docker.md
learn-thread.py
learn_thread.py
linux-tips.md
merge_excel.py
monitor.sh
mydict.py
mysql_init.sql
new.txt
orm.py
parse_excel.py
parse_json.py
payload.py
pm25.py
print_ascii.py
problem.py
python-learn-1.py
python-learn-2.py
qiubai.py
remote.sh
repeated.sql
rpc_server.py
scan.py
scan2.py
score.py
screen.sh
sina_user.json
smz_report.py
sock5.py
sock_client.py
sock_serv.py
system_update.py
t_qiushi.sql
template.xml
test_img2pdf.py
test_pdf2images.py
torrent_client.py
tray.py
update.ico
urls.txt
v2ex.py
v2ex.txt
wifi-keep.sh
wind_crawl.py
xml2vcf.py
克隆/下载
get_version.py 1.80 KB
一键复制 编辑 原始数据 按行查看 历史
mr.github 提交于 11年前 . code clean
import ctypes;
class OSINFO(ctypes.Structure):
_fields_ = [
("dwOSVersionInfoSize",ctypes.c_long),
("dwMajorVersion",ctypes.c_long),
("dwMinorVersion",ctypes.c_long),
("dwBuildNumber",ctypes.c_long),
("dwPlatformId",ctypes.c_long),
("szCSDVersion",ctypes.c_char*128)
];
def GetSystemVersionString():
kernel32 = ctypes.windll.LoadLibrary("kernel32.dll");
os = OSINFO();
os.dwOSVersionInfoSize = ctypes.sizeof(os);
if kernel32.GetVersionExA(ctypes.byref(os))==0:
return "Null Version";
if os.dwPlatformId==1: #windows 95/98/me
if os.dwMajorVersion==4 and os.dwMinorVersion==0:
verStr = "windows 95";
elif os.dwMajorVersion==4 and os.dwMinorVersion==10:
verStr = "windows 98";
elif os.dwMajorVersion==4 and os.dwMinorVersion==90:
verStr = "windows me";
else:
verStr = "unknown version";
elif os.dwPlatformId==2: #windows vista/server 2008/server 2003/xp/2000/nt
if os.dwMajorVersion==4 and os.dwMinorVersion==0:
verStr = "windows nt 4.0";
elif os.dwMajorVersion==5 and os.dwMinorVersion==0:
verStr = "windows 2000";
elif os.dwMajorVersion==5 and os.dwMinorVersion==1:
verStr = "windows xp";
elif os.dwMajorVersion==5 and os.dwMinorVersion==2:
verStr = "windows 2003";
elif os.dwMajorVersion==6 and os.dwMinorVersion==0:
verStr = "windows vista"; # or 2008
elif os.dwMajorVersion>=0:
verStr = "windows 7";
else:
verStr = "unknown version";
else:
return "unknown Version";
return verStr+" build"+str(os.dwBuildNumber)+" "+ctypes.string_at(os.szCSDVersion);
if __name__ == "__main__":
print(GetSystemVersionString());
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/huteddy/python-learn.git
git@gitee.com:huteddy/python-learn.git
huteddy
python-learn
project_20595785
master

搜索帮助