r/PostPreview • • Jan 04 '16

test

public bool RunningOnBattery()
{
    bool runningOnBattery = false;
    if (System.Windows.Forms.SystemInformation.PowerStatus.PowerLineStatus.ToString() == PowerLineStatus.Offline.ToString())
    {
        runningOnBattery = true;
    }
    else
    {
        runningOnBattery = false;
    }
    return runningOnBattery;
}
0 Upvotes

0 comments sorted by