Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7616827
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T02:59:07+00:00 2026-05-31T02:59:07+00:00

I am writing a program in which I use the list webservice of sharepoint

  • 0

I am writing a program in which I use the list webservice of sharepoint and the webclient.DownloadFile method of C# to download all files in a list. The list contains 1800 files which are displayed in 18 pages, resulting in 100 files in each page. However, my code only downloads the files in the first 10 pages (1000 files out of 1800 files). Anyone have any idea what the problem is?
Here is my code

XmlNode ndListItems = null;        
XmlDocument xdoc = new XmlDocument();         
XmlNode ndQuery = xdoc.CreateNode(XmlNodeType.Element, "Query", "");        
XmlNode ndViewFields = xdoc.CreateNode(XmlNodeType.Element, "ViewFields", "");            
XmlNode ndQueryOptions = xdoc.CreateNode  (XmlNodeType.Element, "QueryOptions", "");         
ndQuery.InnerXml = "";        
ndViewFields.InnerXml = "";        
ndQueryOptions.InnerXml   = "<IncludeMandatoryColumns>FALSE</IncludeMandatoryColumns>";    
ndListItems = list.GetListItems(ListName, "", ndQuery, ndViewFields, "1000",   ndQueryOptions, null);   
 if (ndListItems!=null)         
 {             foreach (XmlNode node in ndListItems.ChildNodes)                  {                  if ( node.Name=="rs:data")                
 {                     string[] foldernames = new string[node.ChildNodes.Count];                    
 for (int i = 0; i < node.ChildNodes.Count; i++)                          {                         if (node.ChildNodes[i].Name == "z:row" && node.ChildNodes[i].Attributes != null)                        
 {                             string fileurl= node.ChildNodes[i].Attributes["ows_ServerUrl"].Value;                            
 string filename = node.ChildNodes[i].Attributes["ows_LinkFilename"].Value;                            
 string contenttype = node.ChildNodes[i].Attributes["ows_ContentType"].Value;                             
string copysource = serverAddress + fileurl;                          
  Uri copyUrl = new Uri(copysource);                             
if   (contenttype=="Folder")                            
  {                                 foldernames[i] = filename;                                
 Directory.CreateDirectory(copyDestination+ filename);                                     continue;                             }                                try                             {                               
   int index = FolderNamseContain(filename, copysource, foldernames);                          
      if (index != -1)                                       {                         wc.DownloadFile(copysource, copyDestination + foldernames[index] + "\\" + filename);                                    
 report.Write(fileurl);                                    
 report.WriteLine();                                     
report.Flush();                                 } 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T02:59:09+00:00Added an answer on May 31, 2026 at 2:59 am

    Your problem is here:

    ndListItems = list.GetListItems(ListName, "", ndQuery, ndViewFields, "1000",   ndQueryOptions, null)
    

    You have specified a row limit of 1000 items. Change it to this:

    ndListItems = list.GetListItems(ListName, "", ndQuery, ndViewFields, "2000",   ndQueryOptions, null)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a program which will use scan conversion on triangles to fill in
I'm writing a C++ program for which I would like to use some functionality
I'm writing a Java program in which I'm checking a list against a string,
I am writing a program which needs to be run in Android 2.0. I
I am writing a program which needs to access data in a web server.
I m writing a program which involves converting java.util.Date to java.sql.Date... I've done it
I am writing a program which collects lots of individual pieces of data from
I'm writing a program which has both an ASP.NET configuration system and a Silverlight
I am writing a program which if I compile on a Suse 10 32-bit
I'm writing a program which will allow to load a specific managed .DLL file

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.