开发者

Is any rule to detect that object is serializable in C#? [duplicate]

This question already has answers here: Closed 12 years ago.

Possible Duplicate:

How to check if an object is serializable in C#

Recently found the following sente开发者_运维百科nce:

"Just to enhance, take a thumb rule, the object that support .ToString() are all serializable objects."

This looks like strange as all objects have .ToString() method so in this case all objects must be serializable. Is this sentence make sense?

Also is any rule to detect that specific object is serializable?


If found this article helpfull on this topic:

http://msdn.microsoft.com/en-us/library/ms973893.aspx

The ToString() is not defined to serialize an object. You could implement a class that does have this behaviour but I don't think this would be a good idea.

And yep: already asked. Thought so...

How to check if an object is serializable in C#

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜