A Simple question

A

Adrian

Hi
sorry for such a simple question!

I want to be able to create a structure or is call a class? eg test1

I want it to have a number of elements that I refer to as test1.username,
test1.password...

But I cant think how to do this.

thanks
 
G

Guest

Adrian,
The easy way would be to add a class module to your VB.NET project and add
the following code:

Public Class test1
Public username As String
Public password As String
End Class

To be a little more correct and be ready for any changes you might need to
make try this:

Public Class test1
Private m_username As String
Private m_password As String

Public Property username() As String
Get
Return m_username
End Get
Set(ByVal Value As String)
m_username = Value
End Set
End Property

Public Property password() As String
Get
Return m_password
End Get
Set(ByVal Value As String)
m_password = Value
End Set
End Property
End Class
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top