经常在c#看到
[Serializable]
public class c
{}
请问下.NET是如何把serializable映射到class c,说明此类是可序列化类的?
请问需要满足什么条件的类才可以在[ ]使用?
[Serializable]
public class c
{}
请问下.NET是如何把serializable映射到class c,说明此类是可序列化类的?
请问需要满足什么条件的类才可以在[ ]使用?
{
public string this[int index]
{
get {
return;
}
}
}
{
string[]a={"123","abc"};
public string this[int index]
{
get{
return a[index];
}
}
}使用:
c C=new c();
Console.WriteLine(C[0]);C就是实例,在类c中就是this,this[index]对应a[index]