Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
K

Kyoun

@Kyoun
About
Posts
1
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Serialization problem
    K Kyoun

    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) { hpClass blah = new hpClass(); blah.addToArray( tbFrontFile.Text, tbBackFile.Text ); blah.serializeArray( blah, "test.txt" ); } [Serializable] public class hpClass { Stream[,] images; FileStream fsFront; FileStream fsBack; FileStream fsData; BinaryFormatter bfSerial; public void addToArray(string front, string back) { fsFront = new FileStream( front, FileMode.Open ); fsBack = new FileStream( back, FileMode.Open ); images = new Stream[1, 2] { { fsFront, fsBack } }; } public void serializeArray(object anything, string path) { fsData = new FileStream( path, FileMode.Create ); bfSerial = new BinaryFormatter(); bfSerial.Serialize( fsData, anything ); fsData.Close(); } } 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 :( Any suggestions?

    C# help csharp adobe beta-testing json
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups