avatar
serialization problem# DotNet - 窗口里的风景
k*e
1
it is easy to serialize an instance of object to a file
if the object is serializable. my question is how to
serialize it to an xmlnode? I think it should be ok since
if you serialize it into a file, it is actually an xml file.
but I don't know how to serialize it into an xmlnode directly.
I don't want to write it to a file then read it back as xml.
(sometime you don't have the permission to write file at all).
thanks
avatar
r*e
2
use XMLSerializer

【在 k***e 的大作中提到】
: it is easy to serialize an instance of object to a file
: if the object is serializable. my question is how to
: serialize it to an xmlnode? I think it should be ok since
: if you serialize it into a file, it is actually an xml file.
: but I don't know how to serialize it into an xmlnode directly.
: I don't want to write it to a file then read it back as xml.
: (sometime you don't have the permission to write file at all).
: thanks

avatar
k*e
3
ft, 说的就是这个呀,大部分都是serialize到一个文件。
怎么serialize到一个XmlNode?

【在 r***e 的大作中提到】
: use XMLSerializer
avatar
r*e
4
if all you concern is about not writing to a file, use StringWriter when
calling Serialize().
When u get the string, you can get XMLDocument from it.

【在 k***e 的大作中提到】
: ft, 说的就是这个呀,大部分都是serialize到一个文件。
: 怎么serialize到一个XmlNode?

avatar
k*e
5
got it, thanks.
how do you guys quickly familiar yourself with
so many .net class library?

【在 r***e 的大作中提到】
: if all you concern is about not writing to a file, use StringWriter when
: calling Serialize().
: When u get the string, you can get XMLDocument from it.

avatar
e*g
6
ah.. isn't that silly? an expensive round trip

【在 k***e 的大作中提到】
: got it, thanks.
: how do you guys quickly familiar yourself with
: so many .net class library?

avatar
k*e
7
so what is the short cut?

【在 e***g 的大作中提到】
: ah.. isn't that silly? an expensive round trip
avatar
e*g
8
don't know, i'm just criticizing.
i can imaging that the impl don't use DOM crap internally
which is expensive, it just writes 's directly.

【在 k***e 的大作中提到】
: so what is the short cut?
avatar
a*y
9
I just SOAP it into a string and throw it into a node.:)

【在 k***e 的大作中提到】
: it is easy to serialize an instance of object to a file
: if the object is serializable. my question is how to
: serialize it to an xmlnode? I think it should be ok since
: if you serialize it into a file, it is actually an xml file.
: but I don't know how to serialize it into an xmlnode directly.
: I don't want to write it to a file then read it back as xml.
: (sometime you don't have the permission to write file at all).
: thanks

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。