zoukankan
html css js c++ java
对象序列化为字符串
有点用....
static
string
Ser
<
T
>
(Type type,
object
obj,
string
fileName)
{
try
{
XmlSerializer ser
=
new
XmlSerializer(type);
MemoryStream sw
=
new
MemoryStream();
StreamReader sr
=
new
StreamReader(sw, Encoding.ASCII);
ser.Serialize(sw, obj);
sw.Position
=
0
;
string
ret
=
sr.ReadToEnd();
return
ret;
}
catch
(Exception ex)
{
Console.WriteLine(ex.ToString());
}
return
""
;
}
查看全文
相关阅读:
零基础学python-2.15 回到我们的游戏 加入for以及列表
零基础学python-2.14 for循环语句
零基础学python-在3.x版本之后的print()不换行
零基础学python-2.13 回到我们的游戏 加入循环
CSV文件读取
jmeter 测试webservice协议soap接口
jmeter-plugins-manager.jar插件安装
JDBC协议(jmeter链接mysql)
xftp连接centos7
xshell连接centos7
原文地址:https://www.cnblogs.com/yans/p/1216947.html
最新文章
转---python os.exec*()家族函数的用法
转--python 黑魔法2
转--python 中写单例
python 内建函数专题
delphi执行查询语句时的进度条怎么做
cxGrid数据录入
字符串操作之格式化
cxGrid使用汇总(一)
Delphi应用程序的调试(十)调试器选项
Delphi应用程序的调试(六)步进式代码调试
热门文章
Delphi应用程序的调试(五)其他调试工具
Delphi应用程序的调试(四)The Debug Inspector
Delphi应用程序的调试(三)监视变量
Delphi应用程序的调试(二)使用断点
零基础学python-2.21 回到我们的游戏 加入类和函数
零基础学python-2.19 定义函数、调用函数与默认参数
零基础学python-2.20 类
零基础学python-2.18 异常
零基础学python-2.17 文件、open()、file()
零基础学python-2.16 列表解析
Copyright © 2011-2022 走看看