最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
关于序列化-开心,转来一篇
时间: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();
必须注意,对要序列化的类,以及其包括的其他结构和类,都必须用[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();
相关文章
- 云星穹铁道权益升级怎么玩 云崩铁权益升级活动介绍 12-03
- 以闪亮之名山中绘梦怎么玩 以闪亮之名滢然花梦套装活动介绍 12-03
- 以闪亮之名绿野梦歌礼包怎么样 以闪亮之名绿野梦歌拍照礼包介绍 12-03
- 光遇12.6有什么更新 光遇12月6日更新内容介绍 12-03
- 伍六七暗影交锋测试资格怎么获得 伍六七暗影交锋内测资格获取方法 12-03
- 无限暖暖晶莹诗集怎么样 12-03