Programmaties Lees Lys & View inhoud in SharePoint

Ek het 'n taak om te werk aan die ontwikkeling van die vensters aansoek wat die Lys View data van SharePoint sal haal en verwerk die data in oorwinning vorm app.

Voorheen het ek gebruik om die data met behulp van Lists.asmx te haal,views.asmx.

Nou het ek gekom om te weet daar is ander manier om die data uit Lys View te gaan haal.

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

Example URL:

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

Laat 'n Antwoord

Jy kan gebruik maak hierdie HTML tags

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