في أقل من خطوط قصاصة متاحة لتحديث السجل XML يقوم InfoPath(ملف)
SPList _list = _web.Lists[“SampleFormLib”];
MemoryStream myInStream = MemoryStream جديد(item.File.OpenBinary());
XmlTextReader قارئ = XmlTextReader جديد(myInStream);
= XmlDocument ثيقة جديدة XmlDocument();
doc.Load(قارئ);
reader.Close();
myInStream.Close();
XmlNamespaceManager nameSpaceManager = XmlNamespaceManager جديد(doc.NameTable);
nameSpaceManager.AddNamespace(“لي”, “http://schemas.microsoft.com/office/infopath/2003/myXSD/2009-06-11T12:44:57“);
doc.DocumentElement.SelectSingleNode(“لي:وضع”, nameSpaceManager).النص الداخلي = “حفظ”;
doc.DocumentElement.SelectSingleNode(“لي:SaveDate”, nameSpaceManager).InnerText = DateTime.Today.ToString();
System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();
SPFile newFile = _web.Folders[“SampleFormLib”].Files.Add(item.File.Name.ToString(), (encoding.GetBytes(doc.OuterXml)), صحيح);
item.File.Update();
Make sure you execute item.File.Update() to commit the changes (I got the errors while execute item.Update() and spent couple of hours to find 🙁 )
Have you considered adding some differing opinions to your article? I think it might enhance viewers understanding.