Create, FileAccess.Write, FileShare.None

29 阅读1分钟

IFormatter formatter = new BinaryFormatter();

Stream stream = new FileStream("data.dat", FileMode.Create, FileAccess.Write, FileShare.None);

formatter.Serialize(stream, obj);

stream.Close();

} www.laipuhuo.com/goodsDetail… www.laipuhuo.com/goodsDetail… www.laipuhuo.com/goodsDetail…

www.laipuhuo.com/goodsDetail… www.laipuhuo.com/goodsDetail… www.laipuhuo.com/goodsDetail… www.laipuhuo.com/goodsDetail… www.laipuhuo.com/goodsDetail… www.laipuhuo.com/goodsDetail… www.laipuhuo.com/goodsDetail… www.laipuhuo.com/goodsDetail… www.laipuhuo.com/goodsDetail… }

public class Person {

public string Id www.laipuhuo.com { get; set; }

public string Name { get; set; }

public int Age { get; set; }

public void Say(string word) {

Console.WriteLine($"{Name} Say: {word}");

}

}

public class PersonAgeChangeEvent {

public string Id { www.laipuhuo.com get; private set; }

public int Age{ get; private set; }