Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use VB.NET to display system information

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article will explain in detail how to use VB.NET to display system information. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.

1. New project

Open Visual Studio.NET, select New Project, select Visual Basic Project in the project type window, select Windows Application in the template window, enter "SysInfo" in the name field, and then select the save path. Click OK.

two。 Add a control

Add ten Label controls to the form (which can be arranged through the menu format).

3. Set properti

Change the Text property of the Label control in the left column to be consistent with the interface.

4.VB.NET displays system information and adds code

Private Sub Form1_Load (ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'gets the platform code of the operating system, where 1 means 95Universe 98. 2 means nt/2000 system Select Case sysinfo.OSPlatform Case 1 Label2.Text = "Windows95/98" Case 2 Label2.Text = "WindowsNT/2000" End Select'to get the operating system version number Label4.Text = sysinfo.OSVersion & "." & sysinfo.OSBuild'to get the desktop size Label6.Text = sysinfo.WorkAreaHeight & "X" & sysinfo.WorkAreaWidth'to get the power status value, and 1 to represent the AC element. 0 means battery Select Case sysinfo.ACStatus Case 1 Label8.Text = "AC power" Case 0 Label8.Text = "battery" End Select'to get the remaining battery time. If the battery is AC power, it returns-1, and the other returns 255Select Case sysinfo.BatteryLifeTime Case-1 Label10.Text = "unknown" Case Else Label10.Text = sysinfo.BatteryLifeTime End Select End Sub.

5.VB.NET displays system information to run the program

Click the menu "Debug | start" or click the icon to run the program.

This is the end of this article on "how to use VB.NET to display system information". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report