Results 1 to 4 of 4

Thread: Saving Classes Past Close

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2009
    Posts
    9

    Saving Classes Past Close

    Ihave created several classes and i wanted to know who to store the data enclosed in the classs. For Example
    Code:
    Public Class Session
           Public total_money As Integer
    End Class
    
    
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Dim Session1 As New Session
            Session1.total_money = 8
        End Sub
    If i wanted to store that value past the close of the application, how would I? I already know I cant use the settings class. And what if i have multiple new classes. Help! Thanks

  2. #2
    Frenzied Member
    Join Date
    Aug 2006
    Posts
    1,051

    Re: Saving Classes Past Close

    You'll either save the information to a file or a database.
    If saving to a file, the easiest way is to use serialization.

    Serialization is very easy because it only takes a few lines of code to save all the values
    from the class.

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2009
    Posts
    9

    Re: Saving Classes Past Close

    Quote Originally Posted by FourBlades View Post
    You'll either save the information to a file or a database.
    If saving to a file, the easiest way is to use serialization.

    Serialization is very easy because it only takes a few lines of code to save all the values
    from the class.
    do u think u can give me a quick rundown of what serialization is and how to use it (code, examples etc) or maybe a website about it?

  4. #4
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Saving Classes Past Close

    goto http://msdn.microsoft.com .... search for serialization...

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width