Hi guys

I was wondering if someone could explain to me the differences between these 2 ways of accessing a class property.


Access Way : 1 (To me this looks like im declaring the property of the class as a Global variable which can be changed anywhere
Code:
  Dim username As String
    Public Property user() As String
        Get
            Return username
        End Get
        Set(ByVal value As String)
            username = value.ToUpperInvariant()
        End Set
    End Property
Access Way 2: (This to me looks like the more secure way of doing the same thing.)
Code:
Dim username as String 

Public Sub setUsername(ByVal user as String)
    username = user
End Sub 

Public Function returnUserName() as String
    return username
End Function
I would just like to know when and what is the differences between the 2 methods and what is the security risks of each if possible please.

Kind Regards

Barra.