블로그 이미지
생각처럼

카테고리

전체보기 (209)
TOOL (1)
다이어리 (1)
Bit (200)
HELP? (0)
Total
Today
Yesterday

달력

« » 2025.1
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

공지사항

태그목록

최근에 올라온 글

using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
using System.Runtime.Serialization;
namespace classsave
{
    class Program
    {
        static void Main(string[] args)
        {
            Human h = new Human("dd","111","1123");
            BinaryFormatter format = new BinaryFormatter();
            try
            {
                Stream s = File.Open("c:\\human.txt", FileMode.Create, FileAccess.ReadWrite);
                format.Serialize(s, h);
                s.Close();
                s = File.Open("c:\\human.txt", FileMode.Open, FileAccess.Read);
                Object o = format.Deserialize(s);
                Human r = (Human)o;
                r.Print();
            }
            catch (IOException e)
            {
                Console.WriteLine(e.Message);
            }
            catch (SerializationException e)
            {
                Console.WriteLine(e.Message);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }
    }
}

Posted by 생각처럼
, |

최근에 달린 댓글

최근에 받은 트랙백

글 보관함