Programmatically Léigh Liosta & Féach ar Ábhar i SharePoint

Fuair ​​mé tasc a bheith ag obair ar fhorbairt an t-iarratas fuinneoga a beir na sonraí Féach Liosta ó SharePoint agus na sonraí i bhfoirmeacha bua app phróiseáil.

Roimhe sin a úsáidtear i chun gabháil leis na sonraí ag baint úsáide as Lists.asmx,views.asmx.

Anois, tháinig mé ar an eolas go bhfuil bealach eile chun gabháil na sonraí ó Féach Liosta.

Comhréir:
https://myserver.com/_vti_bin/owssvr.dll?Cmd = Taispeáin&Liosta ={list Id}&View={View Id}&XMLDATA=true

Example URL:

https://myserver.com/_vti_bin/owssvr.dll?Cmd = Taispeáin&Liosta ={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 = Taispeáin&Liosta ={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 nua();
doc.Load(response.GetResponseStream());

Fág Freagra

Is féidir leat úsáid a bhaint na clibeanna HTML

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