Programmiski Lasiet saraksts & Skatīt saturs SharePoint

Es saņēmu uzdevumu strādāt, lai attīstītu Windows pieteikumu, kas piesaistīsim sarakstu Apskatīt datus no SharePoint un apstrādāt datus win formas app.

Agrāk es izmantot, lai piesaistītu datus, izmantojot Lists.asmx,views.asmx.

Tagad es nāca zināt, ka ir cits veids, kā ielādēt datus no saraksta Apskatīt.

Sintakse:
https://myserver.com/_vti_bin/owssvr.dll?Cmd=Display&List={list Id}&View={View Id}&XMLDATA=true

Example URL:

https://myserver.com/_vti_bin/owssvr.dll?Cmd=Display&List={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=Display&List={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 = jauni XmlDocument();
doc.Load(response.GetResponseStream());

Atstāj atbildi

Jūs varat izmantot šo HTML tagus

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