Subscribe in a reader

Add to Technorati Favorites Accessing Sharepoint Documents from Winforms via HTTPS

Accessing Sharepoint Documents from Winforms via HTTPS

by JamieMcAllister 2/10/2008 11:49:00 AM

 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");

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , , ,

Sharepoint | .NET

Related posts

Comments are closed

Powered by BlogEngine.NET 1.3.0.0
Theme by Mads Kristensen

About the author

Jamie McAllister Jamie McAllister
Manchester (UK) Based Consultant for Northridge Solutions Ltd.


Jamie McAllister Linked In
        
        
        
        

Recent posts

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2010

Sign in

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.