Exemplo n.º 1
0
 public RongCloud(RongCloudSetting setting)
 {
     Error.ThrowIfNull(setting, nameof(setting));
     if (string.IsNullOrEmpty(setting.AppKey) || string.IsNullOrEmpty(setting.AppSecret))
     {
         throw new ArgumentException("RongCloud_AppKey 或 RongCloud_AppSecret 未配置");
     }
     _setting = setting;
 }
Exemplo n.º 2
0
        public static RongCloud CreateInstance(RongCloudSetting setting)
        {
            RongCloud rc;

            if (RongCloudCache.TryGetValue(setting.AppKey, out rc))
            {
                return(rc);
            }
            else
            {
                rc = new RongCloud(setting);
                RongCloudCache.TryAdd(setting.AppKey, rc);
                return(rc);
            }
        }