Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
731 B
1
Indexable
Never
   private void Form1_Load(object sender, EventArgs e)
   {
       ObjectQuery query = new ObjectQuery("SELECT * FROM Win32_Battery");
       ManagementObjectSearcher searcher = new ManagementObjectSearcher(query);
       ManagementObjectCollection collection = searcher.Get();

       foreach (ManagementObject mo in collection)
       {
           label1.Text=("Batarya Durumu: " + mo["BatteryStatus"]);
           label2.Text=("Şarj Yüzdesi: " + mo["EstimatedChargeRemaining"]);
           label3.Text = ("Tam Şarj Kapasitesi: " + mo["FullChargeCapacity"]);
           label4.Text = ("Tasarım Kapasitesi: " + mo["DesignCapacity"]);
           label5.Text = ("Batarya Türü: " + mo["Chemistry"]);
       }
   }
Leave a Comment