Site Search:
Sign in | Join | Help

This Blog

Syndication

VB.NET

Notes, Tricks and Tips on VB.NET

Code for a VB AppUser class

This is the class that I use in VB Win Forms applications for user data

 Public Class AppUser
    Public Shared ReadOnly Property UserID() As String
        Get
            Dim strUser As String
            strUser = System.Security.Principal.WindowsIdentity.GetCurrent.ToString
            Return strUser
        End Get
    End Property
    Public Shared ReadOnly Property database() As String
        Get
            Return "dbName"
        End Get
    End Property
    Public Shared ReadOnly Property connectionString() As String
        Get
            Return "Data Source=myServer;User Id=username;Password=mypass;Initial Catalog=dbname"
        End Get
    End Property
End Class

Comments

 

VB.NET said:

Here is my library code for VB Forms apps. Having it available like this helps speed development Write

March 20, 2009 1:10 PM

Leave a Comment

(required)  
(optional)
(required)  
Add

About Steve Gray

Steve is a seasoned (translate: old) developer in VB and ASP.NET. He spends most of his time in Dynamics GP, writing custom mods for consulting firms. Crystal reports, eConnect, VS Tools for Dynamics... anything that comes along.