コード例 #1
0
        public ClientContext GetClientContext(bool isLegacy = true,bool isExternalCall = false)
        {
            try
            {
                var account = new AccountInfo();
                if (isExternalCall)
                {
                    Context = new ClientContext(ApplicationConfiguration.ModernSpInsatance)
                    {
                        Credentials = new NetworkCredential(ApplicationConfiguration.SharePointServiceAccount, ApplicationConfiguration.SharePointServiceAccountCredential, ApplicationConfiguration.Domain)
                    };
                }
                else
                {
                    Context = new ClientContext(ApplicationConfiguration.ModernSpInsatance)
                    {
                        Credentials =
                            account.GetCredentials()
                    };
                }
               

                return Context;
            }
            catch (Exception ex) { throw ex; }
        }
コード例 #2
0
ファイル: Helper.cs プロジェクト: Aranjedeath/SpecimenCode
 public static byte[] ReturnProfileImageBytes(string profileImageUrl)
 {
     var account = new AccountInfo();
     var webClient = new WebClient { Credentials = account.GetCredentials() };
     return webClient.DownloadData(Convert.ToString(profileImageUrl));
 }