我想讀取包含閱讀文本文件,並進行更改C#
<CustomerName>@CoustomerName</CoustomerName>
<CustomerAddress>@CustomerAddress</CustomerAddress>
<CustomerMobileNo>@CustomerMobileNo</CustomerMobileNo>
<Payment>@Payment</Payment>
一個文本文件替換該@CoustomerName與Coustomer名稱通行證在運行時
到那時,我用這個
string readfile = File.ReadAllText(path);
Regex.Replace(readfile , "@CoustomerName ", objProposar.FirstName);
這工作但我需要在Coustomer地址,手機號碼等的變化 我該怎麼辦
它看起來你有* XML *,如果是你的情況,爲什麼不使用'System.Xml.Linq.XDocument'? –