コード例 #1
0
ファイル: AliyunHelper.cs プロジェクト: yeshusuper/Flh
 static AliyunHelper()
 {
     var value = new System.Configuration.AppSettingsReader().GetValue("aliyunAccessKey", typeof(String)) as string;
     if (value != null)
     {
         var arr = value.Split(new []{",", ";"}, StringSplitOptions.RemoveEmptyEntries);
         if (arr.Length > 1)
         {
             string id = arr[0], secret = arr[1];
             if (!String.IsNullOrWhiteSpace(id) && !String.IsNullOrWhiteSpace(secret))
             {
                 AliyunAccessKey = new AliyunAccessKey(id.Trim(), secret.Trim());
             }
         }
     }
 }
コード例 #2
0
        static AliyunHelper()
        {
            var value = new System.Configuration.AppSettingsReader().GetValue("aliyunAccessKey", typeof(String)) as string;

            if (value != null)
            {
                var arr = value.Split(new [] { ",", ";" }, StringSplitOptions.RemoveEmptyEntries);
                if (arr.Length > 1)
                {
                    string id = arr[0], secret = arr[1];
                    if (!String.IsNullOrWhiteSpace(id) && !String.IsNullOrWhiteSpace(secret))
                    {
                        AliyunAccessKey = new AliyunAccessKey(id.Trim(), secret.Trim());
                    }
                }
            }
        }