Results 1 to 6 of 6

Thread: converting a class to string and sending it over the net?

  1. #1

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    converting a class to string and sending it over the net?

    I have a class which contains some variables (strings and integers). Is there an easy way to convert the whole class to string?
    what I want to do is to send the class to another instance of my app over the internet, so I'm assuming it has to be converted to text first. I'm just wondering if there is an easy way for this. Because I actually have like 10 classes and each of them have many different variables in them. Converting a string representation of each to its correct class type would be a little annoying. So is there an easy way to do this?
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    You could serialize it to xml.

  3. #3

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    Originally posted by Edneeis
    You could serialize it to xml.
    Glad to hear there is a way!!!
    I will take a look at it later, thanks.
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  4. #4
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    That is exactly why serialization was created in .Net. You can send objects easily over the Internet.

  5. #5
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    Yep. Xml is great (Assuming you are serializing into Xml). I use it extensively with XSL at my job site.

  6. #6
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729

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