C#Windows 10找出系统何时启动

时间:2016-03-31 20:25:26

标签: c# windows-10

有没有办法找出Windows 10何时启动?此页面中的Advices 无效。它们返回上次重启的时间,不考虑关闭事件。我认为它与Windows 10 fast startup function有关。可能有人知道如何在不关闭此功能的情况下获得正确的结果。

1 个答案:

答案 0 :(得分:-1)

尝试使用此功能,我正在使用它:

var cookie = {
    write : function (cname, cvalue, exdays) {
        var d = new Date();
        d.setTime(d.getTime() + (exdays*24*60*60*1000));
        var expires = "expires="+d.toUTCString();
        document.cookie = cname + "=" + cvalue + "; " + expires;
    },
    read : function (name) {
        if (document.cookie.indexOf(name) > -1) {
            return document.cookie.split(name)[1].split("; ")[0].substr(1)
        } else {
            return "";
        }
    },
    delete : function (cname) {
        var d = new Date();
        d.setTime(d.getTime() - 1000);
        var expires = "expires="+d.toUTCString();
        document.cookie = cname + "=; " + expires;
    }
};