Beispiel #1
0
 private void ButtonCopy_Click(object sender, RoutedEventArgs e)
 {
     using (var lck = new LockForm())
     {
         if (info == null)
         {
             return;
         }
         var sb = new StringBuilder();
         foreach (var item in info.GetType().GetFields())
         {
             sb.AppendFormat("{0}={1}\r\n", item.Name, item.GetValue(info));
         }
         Clipboard.Clear();
         Clipboard.SetText(sb.ToString());
     }
 }
Beispiel #2
0
        private async Task update()
        {
            using (var lck = new LockForm())
            {
                ListBoxDiskInfos.Items.Clear();
                var driveNo = Util.GetSelectedDrive();
                info = await Util.GetDiskInf(driveNo);

                if (info == null)
                {
                    return;
                }
                foreach (var item in info.GetType().GetFields())
                {
                    var v = item.GetValue(info);
                    var s = item.Name + "=" + v.ToString();
                    ListBoxDiskInfos.Items.Add(s);
                }
            }
        }