Click here to Skip to main content
15,891,633 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# Threading Pin
eggie513-Oct-05 20:24
eggie513-Oct-05 20:24 
GeneralRe: C# Threading Pin
Stefan Troschuetz13-Oct-05 22:06
Stefan Troschuetz13-Oct-05 22:06 
QuestionWinForm design question Pin
ben213-Oct-05 11:55
ben213-Oct-05 11:55 
AnswerRe: WinForm design question Pin
Heks13-Oct-05 12:00
Heks13-Oct-05 12:00 
GeneralRe: WinForm design question Pin
ben213-Oct-05 12:31
ben213-Oct-05 12:31 
AnswerRe: WinForm design question Pin
Dave Kreskowiak13-Oct-05 13:53
mveDave Kreskowiak13-Oct-05 13:53 
AnswerRe: WinForm design question Pin
Scott Serl14-Oct-05 6:12
Scott Serl14-Oct-05 6:12 
QuestionSerialization problem Pin
Kyoun13-Oct-05 10:59
Kyoun13-Oct-05 10:59 
I am working on a program to display "flash cards." Basically, the flash cards are 2 jpeg files, the front and the back. I'm using them to aid in learning a foreign language. Currently, I have this code:

private void btAdd_Click(object sender, EventArgs e)<br />
{<br />
    hpClass blah = new hpClass();<br />
    blah.addToArray( tbFrontFile.Text, tbBackFile.Text );<br />
    blah.serializeArray( blah, "test.txt" );<br />
}<br />


    [Serializable]<br />
    public class hpClass<br />
    {<br />
        Stream[,] images;<br />
        FileStream fsFront;<br />
        FileStream fsBack;<br />
        FileStream fsData;<br />
<br />
        BinaryFormatter bfSerial;<br />
<br />
        public void addToArray(string front, string back)<br />
        {<br />
            fsFront = new FileStream( front, FileMode.Open );<br />
            fsBack = new FileStream( back, FileMode.Open );<br />
<br />
            images = new Stream[1, 2]<br />
            {<br />
                { fsFront, fsBack }<br />
            };<br />
        }<br />
<br />
        public void serializeArray(object anything, string path)<br />
        {<br />
            fsData = new FileStream( path, FileMode.Create );<br />
            bfSerial = new BinaryFormatter();<br />
            bfSerial.Serialize( fsData, anything );<br />
            fsData.Close();<br />
        }<br />
    }


The error I am getting is this:

Type 'System.IO.FileStream' in Assembly 'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' is not marked as serializable.

And the bfSerial.Serialize line is the one generating the error. I'm using the C# 2005 Express Edition Beta. I'm completely lost Frown | :( Any suggestions?
AnswerRe: Serialization problem Pin
Matt Gerrans13-Oct-05 11:25
Matt Gerrans13-Oct-05 11:25 
GeneralRe: Serialization problem Pin
Heks13-Oct-05 11:38
Heks13-Oct-05 11:38 
QuestionValidation in Business Layer Pin
tsramkumar13-Oct-05 10:08
tsramkumar13-Oct-05 10:08 
AnswerRe: Validation in Business Layer Pin
facorreia13-Oct-05 11:08
facorreia13-Oct-05 11:08 
QuestionRichTextBox save as HTML Pin
jeweladdict13-Oct-05 8:55
jeweladdict13-Oct-05 8:55 
AnswerRe: RichTextBox save as HTML Pin
Daniel Grunwald13-Oct-05 9:47
Daniel Grunwald13-Oct-05 9:47 
GeneralRe: RichTextBox save as HTML Pin
jeweladdict13-Oct-05 12:09
jeweladdict13-Oct-05 12:09 
GeneralRe: RichTextBox save as HTML Pin
Judah Gabriel Himango13-Oct-05 15:28
sponsorJudah Gabriel Himango13-Oct-05 15:28 
QuestionEnableViewState question Pin
kani9813-Oct-05 8:27
kani9813-Oct-05 8:27 
AnswerRe: EnableViewState question Pin
Guffa13-Oct-05 9:01
Guffa13-Oct-05 9:01 
QuestionAccessing objects in resource files Pin
Rendili13-Oct-05 8:01
Rendili13-Oct-05 8:01 
AnswerRe: Accessing objects in resource files Pin
turbochimp13-Oct-05 20:06
turbochimp13-Oct-05 20:06 
GeneralRe: Accessing objects in resource files Pin
Rendili14-Oct-05 5:49
Rendili14-Oct-05 5:49 
GeneralRe: Accessing objects in resource files Pin
turbochimp14-Oct-05 7:34
turbochimp14-Oct-05 7:34 
GeneralRe: Accessing objects in resource files Pin
Rendili14-Oct-05 7:47
Rendili14-Oct-05 7:47 
GeneralRe: Accessing objects in resource files Pin
turbochimp14-Oct-05 7:57
turbochimp14-Oct-05 7:57 
GeneralRe: Accessing objects in resource files Pin
Rendili14-Oct-05 8:17
Rendili14-Oct-05 8:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.