Is Outlook installed and what version?
In this VB.Net Tutorial/Code Example, I’m going to provide you with a simple class that allows for you to check whether Outlook is installed on the computer and also figure out which version of the Outlook it is.
{code}Imports Microsoft.Win32
Namespace MS.Office
Public Class Outlook
Public Shared Function isInstalled() As Boolean
Dim regClasse...
Check if a VAT Number is valid
In this VB.Net Tutorial/Code Example, I’m going to show you how to check whether a VAT Number is valid or not.
For this piece of code you will need to import “System.Text.RegularExpressions”
Public Shared Function isValidVATNumber(ByVal theVATNumber As String) As Boolean
Dim startChar As String = "^"
Dim endChar As String = "$"
Dim...
How to copy and paste from the Windows clipboard
In this VB.Net Tutorial/Code Example I’m going to show you how to copy text to the Windows clipboard and then get text from the Windows clipboard again.
Public Class Clipboard
''' <summary>
''' This method deals with putting text into the clipboard
''' </summary>
''' <param name="textToCopy">The text to be put ...
Check whether an instance of a form is open
In this VB.Net Tutorial/Code Example I’ll be showing you how to check to see whether there is an instance of a form open in your application.
''' <summary>
''' This method deals with checking to see whether a particular form is open
''' </summary>
''' <param name="formName">The name of the form that you are looking for</par...
How to get all instances of a form
Because in VB.Net you’re able to have multiple instances of a form, sometimes you want to be able to get a list of all of the instances of that form that are open, the following function will do this for you.
''' <summary>
''' This method deals with getting all the instances of a form
''' </summary>
''' <param name="formName">...
Get the username of the currently logged in user
If you want to get the username for the currently logged in user you can use the following code;
Public Shared ReadOnly Property Username() As String
Get
Return System.Environment.UserName
End Get
End Property
Check whether the application is currently being debugged
If you want to know whether the application is currently being debugged you can use the following code;
Public Shared ReadOnly Property DebugMode() As Boolean
Get
Dim rtn As Boolean = False
#If DEBUG Then
rtn = True
#End If
Return rtn
End Get
End Property
The part of code in the if statement will only be exec...
Check whether the current user is an administrator
An extremely simple way to check whether the currently logged in user has administrative rights on the local machine;
Public Shared ReadOnly Property IsUserAdmin() As Boolean
Get
Return My.User.IsInRole(ApplicationServices.BuiltInRole.Administrator)
End Get
End Property
97 post articles, 13 pages.