Code Snippet:
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Net;
- using System.Security;
- using System.Text;
- using System.Threading.Tasks;
- using Microsoft.SharePoint.Client;
- namespace CSOMOffice365
- {
- class Program
- {
- static void Main(string[] args)
- {
- string userName = "[email protected]";
- Console.WriteLine("Enter your password.");
- SecureString password = GetPassword();
- // ClienContext - Get the context for the SharePoint Online Site
- // SharePoint site URL - https://c986.sharepoint.com
- using (var clientContext = new ClientContext("https://c986.sharepoint.com"))
- {
- // SharePoint Online Credentials
- clientContext.Credentials = new SharePointOnlineCredentials(userName, password);
- // Get the SharePoint web
- Web web = clientContext.Web;
- // Regional Settings: Change the calendar type and alternate calendar type
- // Reference: https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.regionalsettings.calendartype.aspx
- RegionalSettings regSet = web.RegionalSettings;
- // Change the calendar type to 5 - Korean Tangun Era
- regSet.CalendarType = 5;
- regSet.AlternateCalendarType = 5;
- // Update the regional settings
- regSet.Update();
- clientContext.Load(regSet);
- // Execute the query to the server
- clientContext.ExecuteQuery();
- // Display the updated calendar type
- Console.WriteLine("Calendar Type: " + regSet.CalendarType + "; Alernate Calendar Type: " + regSet.AlternateCalendarType);
- Console.ReadLine();
- }
- }
- private static SecureString GetPassword()
- {
- ConsoleKeyInfo info;
- //Get the user's password as a SecureString
- SecureString securePassword = new SecureString();
- do
- {
- info = Console.ReadKey(true);
- if (info.Key != ConsoleKey.Enter)
- {
- securePassword.AppendChar(info.KeyChar);
- }
- }
- while (info.Key != ConsoleKey.Enter);
- return securePassword;
- }
- }
- }
Result

Bhuvanesh MohankumarPosted May 18, 2016, 7:44 AM
Good one...
Ketak BhalsingPosted May 17, 2016, 1:54 AM
Good info....
Ketak BhalsingPosted May 17, 2016, 1:54 AM
Good info....