Type("Profile",null,null,null); //表示<!DOCTYPE Profile>
writer.WriteStartElement("Profile"); //生成根元素
writer.WriteElementString("firstname",_firstname); //生成子元素 <firstname>_firstname</firstname>
writer.WriteElementString("lastname",_lastname);
writer.WriteElementString("phonenumber",_phonenumber);
writer.WriteElementString("address1",_address1);
writer.WriteElementString("address2",_address2);
writer.WriteElementString("city",_city);
writer.WriteElementString("state",_state);
writer.WriteElementString("postal",_postal);
writer.WriteEndElement();
writer.Flush();
writer.Close();
}
catch(Exception ee)
{
Console.WriteLine("Exception:{0}",ee.ToString());
}
}
}
}