private void frmCollection_Load(object sender, EventArgs e) { toolStripStatusLabel1.Text = ""; try { string types = new System.Configuration.AppSettingsReader().GetValue("docFiles", typeof(string)).ToString(); docTypes = types.Split(','); } catch { toolStripStatusLabel1.Text = "配置文件读取错误,请设置正确的文件格式"; } }
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()); } } } }
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()); } } } }