哪位大哥帮帮我怎么样写出这样格式的保存为XML文件啊?
<data>
<new>
<news id="1" title="..." time="..." />
</new>
</data>
<data>
<new>
<news id="1" title="..." time="..." />
</new>
</data>
解决方案 »
- 图片不显示
- 怎么把SQLSERVER中的image类型付给Image控件
- 关于ASP.NET中文件下载的问题
- 各位高手,请问asp.net几个人怎样合作开发?
- 如何向WebSite中添加新类???
- (图片传输)用vb.net(可以是其他语言)向.net (api..aspx)接口post二进制文件流怎样在.net里取得值并返回结果.(也就是对post传输"multipart/form-data"的流进行处理与返回)请各位帮帮我~100分...等待中~
- 问一个 .NET 组件的部署问题?
- 100 分求助!!!!!arcgis engine ,如何查询到的某条街道在屏幕中间显示?
- 如何在DataGird中某一列设置为超链接?
- 郁闷~~在时创买的.net主机已经4天不能访问啦!
- 奇怪问题```GridView点编辑时绑顶DropDownList时出现的````大家看看!急``
- 结贴率太低了,周末大家好好过吧!
{
sw.WriteLine("<?xml version=\"1.0\" encoding=\"utf-8\" ?>");
sw.WriteLine("<data>");
sw.WriteLine("\t<new>");
sw.Write("\t\t<news ");
sw.Write("id=\"1\" ");
sw.Write("title=\"1\"");
....................
sw.WriteLine("\t\t</news>");
sw.WriteLine("\t</new>");
sw.WriteLine("</data>");
据个例子:
news表:ID Title Content DateTime
1 11111 1111111 2007/08/24
根据news表的结构使用C#代码 很容易生成下面的代码:
<?xml version=\"1.0\" encoding=\"utf-8\" ?>
<news>
<new>
<ID>1</ID>
<Title>11111</Title>
<Content>1111111</Content>
<DateTime>2007/08/24</DateTime>
</new>
<new>
..........
..........
</new>
</news>