C# 用c语言创建特定格式的XMl文件
我想用c创建以下格式的xml文件 你好 世界 试试这个C# 用c语言创建特定格式的XMl文件,c#,xml,C#,Xml,我想用c创建以下格式的xml文件 你好 世界 试试这个 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml; using System.Xml.Linq; namespace ConsoleApplication85 { class Program { static void Main(string[] a
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.Xml.Linq;
namespace ConsoleApplication85
{
class Program
{
static void Main(string[] args)
{
//<custom>
// <text1>
// <value name="sample1">hello</value>
// </text1>
// <text1><value name="sample2">world</value>
// </text1>
// </custom>
XElement custom = new XElement("custom", new object[] {
new XElement("Text1", new object[] {
new XElement("value", new object[] {
new XAttribute("name", "sample1"),
"hello"
})
}),
new XElement("Text1", new object[] {
new XElement("value", new object[] {
new XAttribute("name", "sample2"),
"world"
})
})
});
}
}
}
“问题是什么?”卡拉,我想这是一个要求。现在就给他写@NitinK到目前为止你尝试了什么?你在哪里被卡住了?请阅读:可能的副本