//Add attribute id2
XmlDocument xDoc = new XmlDocument();
xDoc.Load (tmpFilename);
foreach (XmlNode unNodo in xDoc.DocumentElement.GetElementsByTagName(“nodo”) )
{
XmlAttribute nAttr;
nAttr = xDoc.CreateAttribute (“id2″);
nAttr.Value= unNodo.Attributes["id"].Value ;
unNodo.Attributes.Append( nAttr);
}
xDoc.Save(tmpFilename);
含有 ‘Xml’標籤(tag)的文章們
2 九月
Creating or adding an attribute (xmlAttribute) on a node in c# with Visual Studio2005
1 九月
Modify XML Attribute of Element
XmlDocument doc = new XmlDocument();
doc.LoadXml(“” +
“Pride And Prejudice” +
[...]
3 八月
From DataSet To Html & Excel (方法一)
private int ExportExcel(string strCondition)
{
//Get Export Data
ORDER_REQUEST objOR = new ORDER_REQUEST();
DataSet dsResult = new DataSet();
objOR.GetList_ModelExport(strCondition, out dsResult); //DataSetName = “NewDataSet” , TableName = “data”
//Check Data Existed Or Not
if (dsResult != null && dsResult.Tables.Count != 0 && dsResult.Tables[0].Rows.Count > 0)
{
//Get FileName
Random rd = new Random();
String filePathHtml = “././DownLoadFile/” + Convert.ToString(rd.Next()) + “.html”;
String filePathExcel = filePathHtml.Replace(“html”, “xls”);
//Create the [...]