如何在C#中创建XML文件 [英] How to make XML file in C#
本文介绍了如何在C#中创建XML文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
<?xml version="1.0" standalone="no"?>
<Ship xsi:noNamespaceSchemaLocation="C:\AVEVA\Marine\OH12.1.SP2\xml\CurvedHullz.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ShellPlate PosNoPS="123" PosNoSB="123" ObjId="TEST123">
<Edge ObjId="MARS120"/>
<Edge ObjId="MARS226"/>
<Edge ObjId="MARS111"/>
<Edge ObjId="MARS303"/>
<shellplatedata>
<Material Thickness="15" Grade="A"/>
<Position Symmetry="Symmetric" MaterialSide="Out"/>
<generalpurpose>
<shrinkage>
<DevOptions RollAxes="true" WorkshopMethod="Contraction" StripControl="PrincipalPlane" StripDirection="Auto" RawPlateMargin="15" NumStrips="8" SplineTolerance="1" NeutralPlaneLocFact="0.50"/>
<ppi>
<BendTempl Side="Auto"/>
<cpanparts>
我想用C#制作XML文件,但我不知道如何制作这种格式
plz帮助我
我尝试过的事情:
i am newbie developer TT plz帮我解决
I would like to make XML file in C# but i dont know how to make that format
plz help me out
What I have tried:
i am newbie developer TT plz help me out
推荐答案
它的goignto在很大程度上依赖于你的数据,但创建XML文件的最简单方法是使用 XmlSerializer类(System.Xml.Serialization) [ ^ ]
这里有一些例子: XML序列化示例 [ ^ ]
It's goignto depend on your data to a large extent, but the simplest way to create an XML file is to use the XmlSerializer Class (System.Xml.Serialization)[^]
There are examples here: Examples of XML Serialization[^]
这篇关于如何在C#中创建XML文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文