<gs***@hotmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
:
: Hi!
:
: As a training case I'm trying to build a class, in VB.NET, that will
: hold my friends names, addresses, zipcodes and cities, emails, like
: this:
:
: Public Class ContaktsData
:
: Public fName As String
: Public lName As String
: Public fAdr As String
: Public fZip As String
: Public fEmail As String
:
:
: End Class
:
: However...Can anybody help me out with a simple example on how to
: build this class, or point me to an article that deals with this
: subject?
:
: I want to store the information from a form to a .dat file I think
: in the end.
:
: Me.Name
You've got a good start. Don't make the fields public however - access
then via properties. For example:
Public Property FirstName() As String
Get
Return fName
End Get
Set
fName = value
End Set
End Property
Secondly, you'll want a collection of the contacts. One approach would
be to reference the System.Collections namespace and declare a class
that inherits from CollectionBase (see the SDK documentation for an
example of how to implement this).
You'll also want some way of reading in the data as well as saving it
when you're done. So in addition to the logic needed to flesh out the
CollectionBase derived class, you'll probably want some functions to
load the existing data and save the new data from and to your .dat file.
Finally, create an application that will provide you with a way of
actually putting this class to work.
I hope this is what you were looking for. Good luck and have fun.
Ralf
--
----------------------------------------------------------
* ^~^ ^~^ *
* _ {~ ~} {~ ~} _ *
* /_``>*< >*<''_\ *
* (\--_)++) (++(_--/) *
----------------------------------------------------------
There are no advanced students in Aikido - there are only
competent beginners. There are no advanced techniques -
only the correct application of basic principles.