Subscribe in a reader

Add to Technorati Favorites Sharepoint Nirvana | Accessing Sharepoint Documents from Winforms via HTTPS

Accessing Sharepoint Documents from Winforms via HTTPS

by Jamie McAllister 10. February 2008 15:49

 I was recently asked how someone could access a document in a Sharepoint list from a Winforms client. His only caveat was that it was secured via SSL.

This is the code I gave him, and it seems to work!

System.Net.WebClient Client = new System.Net.WebClient();

Client.UseDefaultCredentials = false ;

System.Net.ICredentials creds;

creds = new System.Net.NetworkCredential(@"MyUserID", "MyPassword");

Client.Credentials = creds;

Client.DownloadFile("https://www.MyDomain.com/someFolder/shared%20documents/DocumentIWant.doc", @"C:\DocumentIWant.doc");

Tags: , , ,

Sharepoint | .NET

About the author

Jamie McAllister Jamie McAllister is a SharePoint consultant based in Geneva, Switzerland.

Book List

      
      
      
      

    Disclaimer: The software and source code on this website is provided "AS IS"
    with no warranties of any kind. The entire risk arising out of the use or
    performance of the software and source code is with you.