1 Public voidAlterxml (stringpathstring)//list<string> name,list<string> value)2 {3 Try4 {5XmlDocument xmldoc =NewXmlDocument ();6 xmldoc. Load (pathstring);7XmlNodeList RootNode =xmldoc. Documentelement.childnodes;8 //XmlNodeList Xmlnodel = RootNode. ChildNodes;9 Ten foreach(XmlNode xninchRootNode) One { A if(xn. name.tostring () = ="Invoice_customer_info") -Xn. InnerText ="Customer_code~~customer_name~~customer_mne~~customer_tax~~customer_address~~customer_bank~~~~customer_ notes~~"; - if(xn. name.tostring () = ="Invoice_product_info") theXn. InnerText ="item_code~~item_name~~item_mne~~tax_nb~~tax_rate~~item_stand~~item_unit~~item_price~~tax_flag~~~~~~ goodstaxno~~~~~~~~~~"; - - - } + xmldoc. Save (pathstring); - //return ""; + } A Catch(Exception e) at { -StreamWriter SW =NewStreamWriter (Application.startuppath +"Log.txt",true); -Sw. Write (System.DateTime.Now.ToString ("Yyymmddddss") +" "+e.tostring ()); - SW. Close (); - - } in -}
Change XML file contents (Invoice management software)