How to download/upload files from/to SharePoint 2013 using CSOM?

Upload a file Upload a file to a SharePoint site (including SharePoint Online) using File.SaveBinaryDirect Method: using (var clientContext = new ClientContext(url)) { using (var fs = new FileStream(fileName, FileMode.Open)) { var fi = new FileInfo(fileName); var list = clientContext.Web.Lists.GetByTitle(listTitle); clientContext.Load(list.RootFolder); clientContext.ExecuteQuery(); var fileUrl = String.Format(“{0}/{1}”, list.RootFolder.ServerRelativeUrl, fi.Name); Microsoft.SharePoint.Client.File.SaveBinaryDirect(clientContext, fileUrl, fs, true); } } Download … Read more

What are the pros and cons of writing C#/XAML vs. C++/XAML WinRT applications in Windows8? [closed]

I see the difference as a design choice, than a personal preference of language. Preference would be more related to VB vs C#. And generally it’s the same differences you get in any application where you choose C++ or .NET. C++ will give you faster startup times. IIRC, .NET 4.5 has auto NGENing abilities (not … Read more

HttpClient Request like browser

Here you go – note you have to decompress the gzip encoded-result you get back as per mleroy: private static readonly HttpClient _HttpClient = new HttpClient(); private static async Task<string> GetResponse(string url) { using (var request = new HttpRequestMessage(HttpMethod.Get, new Uri(url))) { request.Headers.TryAddWithoutValidation(“Accept”, “text/html,application/xhtml+xml,application/xml”); request.Headers.TryAddWithoutValidation(“Accept-Encoding”, “gzip, deflate”); request.Headers.TryAddWithoutValidation(“User-Agent”, “Mozilla/5.0 (Windows NT 6.2; WOW64; rv:19.0) Gecko/20100101 … Read more

Do Windows 8 Store Apps (Metro) run in Windows 7 or XP?

What new things needed to run Metro Apps in Windows XP or Windows 7 A virtual machine of Windows 8. Metro apps currently don’t run on Windows 7, and definitely don’t on Windows XP. According to this thread, it’s difficult but might happen eventually: Keep your eyes out on future Channel 9 videos and on … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)