日期:2014-05-17 浏览次数:20828 次
XmlWriterSettings settings = new XmlWriterSettings();
settings.Indent = true;
settings.IndentChars = (" ");
settings.CloseOutput = true;
settings.OmitXmlDeclaration = true;
using (XmlWriter writer = XmlWriter.Create(output, settings))
{
// writer.WriteStartElement(root);
writer.WriteStartDocument();
ArrayList arrText = new ArrayList();
StreamReader objReader = new StreamReader(pathtext);
while (!objReader.EndOfStream)
{
String sLine = objReader.ReadLine();
int start = sLine.IndexOf('(');
int end = sLine.IndexOf(')');
string temp = sLine.Substring(start + 1, end - start - 1);
string[] s = temp.Split(',');
string temp1 = null;
for (int i = 0; i < s.Length; i++)
{
if (s[i].Contains("'"))
{
temp1 = s[i].Substring(1, s[i].Length - 2);