[HELP]Get your OS Version, Vb2008[Solved]

Posts 1–12 of 12 · Page 1 of 1
[HELP]Get your OS Version, Vb2008[Solved]
Hello,
i just wonna ask is it possible to make app in vb what detects your OS?
My.Computer.Information.OSFullName
That also working!
thanks guys!
Thanks Blub!
Easy Method is to create a function.


[highlight=vbnet]
Public Function GetWinVer() As String
Return Environment.OSVersion.ToString
End Function
[/highlight]

You can use this any way you like because the function will return the OS Version.

Examples

[highlight=vbnet]
Msgbox (GetWinVer())
[/highlight]

[highlight=vbnet]
Textbox1.Text = GetWinVer()
[/highlight]

[highlight=vbnet]
Label1.Text = GetWinVer()
[/highlight]



Quote Originally Posted by NextGen1 View Post
Easy Method is to create a function.


[highlight=vbnet]
Public Function GetWinVer() As String
Return Environment.OSVersion.ToString
End Function
[/highlight]

You can use this any way you like because the function will return the OS Version.

Examples

[highlight=vbnet]
Msgbox (GetWinVer())
[/highlight]

[highlight=vbnet]
Textbox1.Text = GetWinVer()
[/highlight]

[highlight=vbnet]
Label1.Text = GetWinVer()
[/highlight]



Won't this more likely return a VERSION number.

I would suggest going for OSFullName. His decision

I'm not exactly sure what Version returns so .

Mark this as solved...
No problem, I just prefer a function. This way you don't need to call the same one line every time you want to use it.

Just create a short function name, like OS or GetOs or W/e.

@ Blubb, Yes it will

If he wants 'Friendly Version Name' then same idea

[highlight=vbnet]
Public Function GetWinVer() As String
Return My.Computer.Info.OSFullName
End Function
[/highlight]

Info Btw.


6.1 is win 7
6.0 is vista
5.# is either XP or NT
Sometimes you relay pointless information, seeing as a alternative and solution was already offered.
I dunno I like using numbers then converting it to text, but that's me...
thanks for making this thread lol i might use these codes.
Posts 1–12 of 12 · Page 1 of 1
This thread is closed for replies.

Tags for this Thread

None

Talk with us