Пример #1
0
 private void btnUpdate_Click(object sender, EventArgs e)
 {
     try
     {
         var kvGovern = new KVGovern();
         var result   = kvGovern.CreateUpdateKey(new CreateUpdateKeyParmeter {
             DC = "dc1", Key = txbKey.Text, Value = txbValue.Text
         });
         if (result)
         {
             MessageBox.Show("修改成功!");
             txbKey.Clear();
             txbValue.Clear();
             LoadConfig();
         }
         else
         {
             MessageBox.Show("修改失败!");
         }
     }
     catch (Exception exc)
     {
         MessageBox.Show(exc.Message);
     }
 }
Пример #2
0
        /// <summary>
        /// Create/UpdateKey
        /// </summary>
        private static void CreateUpdateKey()
        {
            var kvGovern = new KVGovern();
            var result   = kvGovern.CreateUpdateKey(new CreateUpdateKeyParmeter {
                Key = "testkey", DC = "dc2", Acquire = "a", Release = "b"
            }, "abc").GetAwaiter().GetResult();

            Console.WriteLine(EntityToString(result));
        }