一聚教程网:一个值得你收藏的教程网站

最新下载

热门教程

关于序列化-开心,转来一篇

时间:2022-07-02 11:40:01 编辑:袖梨 来源:一聚教程网

建立一个Serialization类,包括两个静态方法Save和Get。见程序中的
必须注意,对要序列化的类,以及其包括的其他结构和类,都必须用[Serializable]或者[NonSerialized]来标记。
NET Serialization By Vyacheslav Biktagirov
.NET enters in our life. So, we must at least learn what about new technoloy of. I think, that XML persistance is one of keys that make .NET belling so good.. OK. So what about persisting of? Imagine we have a class value. In C# termines, like that:
    public class NiceClass
    {
    public long SomeLong=10;
    private string str="Now nothing";
    public int SomeInt=15;
    public string SomeString
    {
        get
        {
       return str;
        }
        set
        {
       str=value;
        }
    }
        public NiceClass()
        {
        }
    }
Okay, it has some members and one property. Now, we get instance of such class:
NiceClass x=new NiceClass();

热门栏目