try
{
XElement contactsFromFile = XElement.Load("App_Data/EmployeeFinList.xml");
var xEle = new XElement("Employees",
from emp in ListFromBasicPay
select new XElement("Employee",
new XAttribute("EmpID", emp.employee_personal_id),
new XElement("GrandTotal", emp.grandTotal),
new XElement("Housing", emp.housing),
new XElement("BasePay", emp.base_pay),
new XElement("XchangeRate", emp.Exchange_rate)));
xEle.Save("..\\changesetDB.xml");
Debug.WriteLine("Converted to XML");
}
catch (Exception ex)
{
Debug.WriteLine(ex.Message);
}
Run Code Online (Sandbox Code Playgroud)
我想将xml文件保存在我在项目中创建的文件夹中.然后我将使用在我的文件夹中创建的xml文件并从中读取和写入.知道怎么做吗?
我有一个textbox,我希望它被格式化。对我来说幸运的是,我可以通过更改textmode = DateTimeLocal. 正是我想要的。此外,我想使用默认值加载此文本框,而不是将其保留为dd/mm/yy __:__:__. 如果文本是常规文本框 ( single mode) 甚至日期时间文本框,我可以更改文本。但我不能用DateTimeLocal模式改变它。请一些帮助。谢谢你。