1: Imports System.Environment 2: Public Class pOS 3: ReadOnly Property SystemD As String 4: Get 5: Return Environment.SystemDirectory 6: End Get 7: End Property 8:
'Nome do usuário
9: ReadOnly Property Domain() As String 10: Get 11: Return Environment.UserName.ToString 12: End Get 13: End Property 14:
'Retorna o nome do Sistema Operacional
15: ReadOnly Property Version() As String 16: Get 17: Return OSVersion.Platform.ToString 18: End Get 19: End Property 20:
'Retorna a versão do Sistema operacional
21: ReadOnly Property SVersion() As String 22: Get 23: Return OSVersion.Version.ToString 24: End Get 25: End Property 26:
'Retorna qual service pack está utilizando
27: ReadOnly Property Service() As String 28: Get 29: Try 30: Return OSVersion.ServicePack.ToString 31: Catch err As Exception 32: Return "Erro " & err.Message 33: End Try 34: End Get 35: End Property
Para chamar determinada função;
1: Dim info As new infoDisco
2: Textbox1.Text = info.Domain()
0 comentários:
Postar um comentário