Download excel files from sharepoint site to local system using C#

  using (ClientContext clientContext = new ClientContext(@"https://cm365.sharepoint.com/sites/intranet/cs/"))
        {
            SecureString passWord = new SecureString();

            foreach (char c in "password".ToCharArray()) passWord.AppendChar(c);

            clientContext.Credentials = new SharePointOnlineCredentials("username", passWord);

            Web web = clientContext.Web;

            clientContext.Load(web);

            clientContext.ExecuteQuery();

            Console.WriteLine(web.Title);

            Console.ReadLine();
        }

unable to connect share point site

.NET Foundation Website | Blog | Projects | Code of Conduct