Programmatically Darllenwch Rhestr & View Cynnwys yn SharePoint

Ges tasg i weithio ar ddatblygu y cais ffenestri a fydd yn nôl y data Rhestr Yr olygfa o SharePoint a phrosesu'r data mewn ffurfiau ennill app.

Yn flaenorol i ddefnyddio i nôl y data gan ddefnyddio Lists.asmx,views.asmx.

Yn awr i ddod i wybod nad oes ffordd arall i nôl y data o List View.

Cystrawen:
https://myserver.com/_vti_bin/owssvr.dll?Cmd = Arddangos&Rhestr ={list Id}&View={View Id}&XMLDATA=true

Example URL:

https://myserver.com/_vti_bin/owssvr.dll?Cmd = Arddangos&Rhestr ={EA1BD05B-DB5B-434B-B2FC-B9AB9EE18A91}&View={B959F555-798B-4F47-9FBB-81513B85F906}&XMLDATA=true

Now it will give the xml data as response.

write the response to xmldoc and process the data.

HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(“https://myserver.com/_vti_bin/owssvr.dll?Cmd = Arddangos&Rhestr ={EA1BD05B-DB5B-434B-B2FC-B9AB9EE18A91}&View={B959F555-798B-4F47-9FBB-81513B85F906}&XMLDATA=true”);

myRequest.Credentials =
System.Net.CredentialCache.DefaultCredentials;
HttpWebResponse response = (HttpWebResponse)myRequest.GetResponse();
XmlDocument doc = XmlDocument newydd();
doc.Load(response.GetResponseStream());

Ad a Ateb

Gallwch ddefnyddio tagiau HTML hyn

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>