This single line of VB.NET code below will put the name of the current Windows user into the currentUserName variable:
Getting remaining battery power and battery status using VB.NET
The following VB.NET will make use of the SystemInformation class in order to obtain the battery charge status in percentages and the current power source: AC power / battery charging or battery power / battery not charging.
Get current screen resolution in VB.NET
To get the current screen resolution in VB.NET you can use the Bounds.Height and Bounds.Width properties as such:
Determine if the computer is connected to a network
The following piece of code uses the My.Computer.Network.IsAvailable property to determine whether or not the computer is connected to a network. This network could be the Internet or a local network; for as long as the computer is connected to one such network, the response retrieved will be positive. This Visual Basic (VB.NET) code snippet is used […]
Open a web page in the default browser
Opening an URL in the default browser using VB.NET could not be any simpler. All you need to do is to invoke the Process.Start() method and pass the URL of the page that you wish to open:
Validate email addresses using VB.NET
Using RegEx this VB.NET code validates an email address. It’s checking for a string separated by the at (@) character, and again separated by a dot.
Get a list of the files in the clipboard
This few lines of code are retrieving the list of files that are copied to the clipboard, if any.
Detect multiple instances of the application
This Visual Basic .NET code will detect if multiple instances of the current application are running by retrieving the number of running processes with the same name.
Replace Last Occurrence In String
Replace only the last occurrence of a string within a larger string, using a VB.NET code snippet.