How to serialize static members of a class?
-
I want to binary serialize a class, which has only static items (variables & objects of different types) which I use globally in my code. When I want to serialize it, I get the error "'EmailAccount' is a type and cannot be used as an expression" :
binformatter.Serialize(filstream, EmailAccount);
I even tried to create an object from the class and serialize it. But it seems to only save the instance variables and not the static ones. Is there a way to serialize them? -
I want to binary serialize a class, which has only static items (variables & objects of different types) which I use globally in my code. When I want to serialize it, I get the error "'EmailAccount' is a type and cannot be used as an expression" :
binformatter.Serialize(filstream, EmailAccount);
I even tried to create an object from the class and serialize it. But it seems to only save the instance variables and not the static ones. Is there a way to serialize them?Do not cross post in multiple forums. It is considered rude and make it very difficult to colaborate on answers. I already answered your question in the VB.NET forum.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009... -
Do not cross post in multiple forums. It is considered rude and make it very difficult to colaborate on answers. I already answered your question in the VB.NET forum.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009...And I have in Q&A:mad:
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.” Why do programmers often confuse Halloween and Christmas? Because 31 Oct = 25 Dec.
-
And I have in Q&A:mad:
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.” Why do programmers often confuse Halloween and Christmas? Because 31 Oct = 25 Dec.
Thank you both... I removed the message.