1樓:匿名使用者
'*** 獲取作業系統版本的模組部分
public declare function getversionex lib "kernel32" alias "getversionexa" (lpversioninformation as osversioninfo) as long
public type osversioninfo
dwosversioninfosize as long
dwmajorversion as long
dwminorversion as long
dwbuildnumber as long
dwplatformid as long
szcsdversion as string * 128
end type
'以下可以放入窗體 當然也可以在其它地方
private sub form_load()
dim a as string, v as osversioninfo
on error resume next
v.dwosversioninfosize = 148
v.szcsdversion = space(128)
a = getversionex(v)
select case v.dwplatformid
case 0: opsys = "windows 3.x"
case 1: opsys = "windows 98"
case 2: opsys = "windows nt"
end select
if v.dwmajorversion = 5 then opsys = "windows xp " & rtrim(v.szcsdversion)
if v.dwmajorversion > 5 then opsys = "windows7"
end sub
2樓:匿名使用者
可以用一下**得到系統版本等資訊
private declare function getversionex lib "kernel32" alias "getversionexa" (lpversioninformation as osversioninfo) as long
private type osversioninfo
dwosversioninfosize as long
dwmajorversion as long
dwminorversion as long
dwbuildnumber as long
dwplatformid as long
szcsdversion as string * 128
end type
public osname$, tmpstr$, ary
private sub form_activate()
ary = array("", "windows 95", "windows 98", "windows me", "windows nt4.0", "windows 2000", "windows xp", "windows 2003", "windows vista", "windows 7")
msgbox "您的作業系統是:" & ary(getversion)
end sub
public function getversion() as long
dim osinfo as osversioninfo
call getversionex(osinfo)
osinfo.dwosversioninfosize = 148
osinfo.szcsdversion = space(128)
call getversionex(osinfo)
select case osinfo.dwplatformid
case ver_platform_win32s
osname = "windows 3.1"
case ver_platform_win32_windows
osname = "windows 98"
case ver_platform_win32_nt
osname = "windows nt"
end select
tmpstr = osname & "(" & osinfo.dwmajorversion & "." & osinfo.dwminorversion & ")"
if instr(tmpstr$, "95") then getversion = 1: exit function
if instr(tmpstr$, "98") then getversion = 2: exit function
if instr(tmpstr$, "me") then getversion = 3: exit function
if instr(tmpstr$, "4.0") then getversion = 4: exit function
if instr(tmpstr$, "5.0") then getversion = 5: exit function
if instr(tmpstr$, "5.1") then getversion = 6: exit function
if instr(tmpstr$, "5.2") then getversion = 7: exit function
if instr(tmpstr$, "6.0") then getversion = 8: exit function
if instr(tmpstr$, "6.1") then getversion = 9
end function
3樓:匿名使用者
如果要求不是很嚴格,用environ$("os")返回環境變數也能識別系統。
vb 檢測程式是否正在執行,若正在執行則顯示窗體
4樓:
vb遍歷程序查詢視窗,這個過程很繁瑣,而且**量很大,所以我的**用了巧妙的方法,在執行時在登錄檔儲存了視窗控制代碼,這樣就不用再查詢了。測試通過,環境win7+vb6:
5樓:匿名使用者
'一、form_load中
『獲得已執行程的控制代碼,然後傳送自定義結構的訊息exit sub
end if
'二、hook訊息,顯示程式
vb判斷作業系統型別
6樓:匿名使用者
如何用vb**實現判斷當前的作業系統是中文的還是英文的,如,中文的xp系統還是英文的xp,謝謝! 通過api 函式getsystemdefaultlcid 判斷系統的語言 option
7樓:
private declare function getversionex lib "kernel32" alias "getversionexa" (lpversioninformation as osversiononfo) as long
private type osversiononfo
dwosversioninfosize as long
dwmajorversion as long
dwminorversion as long
dwbuildnumber as long
dwplatformld as long
dwcsdversion as string * 128
end type
public function systemver() as variant
dim osinfor as osversiononfo, strosname as string
osinfor.dwosversioninfosize = len(osinfor)
getversionex osinfor
select case osinfor.dwplatformld
case 0
strosname = "windows 32s"
case 1
select case osinfor.dwminorversion
case 0
strosname = "windows 95"
case 10
strosname = "windows 98"
case 90
strosname = "windows mellinnium"
end select
case 2
select case osinfor.dwmajorversion
case 3
strosname = "windowsnt 3.51"
case 4
strosname = "windowsnt 4.0"
case 5
select case osinfor.dwminorversion
case 0
strosname = "windows 2000"
case 1
strosname = "windows xp"
case 2
strosname = "windows 2003"
end select
case 6
select case osinfor.dwminorversion
case 0
strosname = "windows vista"
case 1
strosname = "windows 7"
end select
end select
case else
strosname = "未知系統版本"
end select
systemver = strosname
end function
private sub command1_click()
msgbox systemver
end sub
win8系統下為什麼打不開vb6.0?
8樓:匿名使用者
vb6太老了!vb6推出時windows系統是win98,此後,windows系統不斷進化,windows me/2000/xp/vista/win7/win8/win8.1/win10
vb6的核心是activex技術,而這個技術在vista/win7/win8系統漸漸淡去。這就是vb6在這些系統上不能很好執行的根本原因。
vb60怎麼安裝系統是,VB6 0怎麼安裝 系統是WIN
我就是win7 64位旗艦版,安裝的是vb6.0的精簡版。不過vb6.0必須在win7下面修改一下相容性,不然win7特效會讓vb6.0各種控制項像烏龜一樣慢,修改方法是,在安裝好的vb6.0.exe檔案上點滑鼠右鍵,選擇屬性,然後按照下圖操作。可以安裝。用管理員許可權執行。win7 64位系統怎麼...
如何把當前系統做成光碟系統映象?
我來教你,我已經教過很多人了。a.啟動到你的pe系統。b.在pe中用ghost來做你現在系統的鏡象檔案名字隨意如。鏡象做到硬碟的其它分割槽上 這樣能快 c.找到你u盤pe上的ghost檔案的鏡象,用筆記下它的名字和位置。並將它刪除。d.將你硬碟上剛剛做好的鏡象改為剛剛刪除的檔名,並將它複製到u盤相應...
作業系統畫出當前狀態系統rag圖
假設系統中程序的三態模型如下圖所示,圖中的a和b處應分別填寫 26 圖中的c和d處應分別填寫 27 26 a 時間片到 作業排程程式排程 b 執行了p操作 時間片到 c 時間片到 程序排程程式排程 d 時間片到 執行了p操作 27 a i o完成 執行了p操作 b 執行了p操作 i o完成 c 時間...