- 文章出处:http://blog.csdn.net/lab2013/article/details/7181299
- using System.IO;
- using System.Runtime.Serialization.Formatters.Binary;
- ....
- ...
-
- Hashtable aa = new Hashtable();
-
- private void buttonSave_Click(object sender, EventArgs e)
- {
- FileStream fs = new FileStream("e:\\aa.dat", FileMode.Create);
- BinaryFormatter bf = new BinaryFormatter();
- bf.Serialize(fs, aa);
- fs.Close();
- }
-
- private void buttonLoad_Click(object sender, EventArgs e)
- {
- aa.Clear();
- FileStream fs = new FileStream("e:\\aa.dat", FileMode.OpenOrCreate);
- BinaryFormatter bf = new BinaryFormatter();
- aa = (Hashtable)bf.Deserialize(fs);
- fs.Close();
- }
posted on
2013-01-05 13:06
bobird
阅读(
850)
评论()
收藏
举报