Ada 2 cara untuk mengetahui OS version dalam aplikasi VB :
1. menggunakan My.Computer.Info.OSVersion
LblOS.Text = My.Computer.Info.OSVersion
2. menggunakan IntPtr.Size
Sub Get_OSVer()
Try
'
'Basically if the Integer Pointer size is 4 then its 32 Bit and 8 is 64 Bit
If IntPtr.Size > 4 Then
OS_type = 64
Else OS_type = 32
End If
Catch exc As Exception
MessageBox.Show(exc.Message, " We have a IntPtr problem...", MessageBoxButtons.OK)
Return
End Try
End Sub
setelah mencoba 2 cara di atas, yang paling valid adalah cara kedua.
kalau cara pertama masih “terjebak” dalam desain OS “maksa” 64bit.

Tidak ada komentar:
Posting Komentar