close
System.Management.ObjectQuery MyQuery=new ObjectQuery("SELECT * FROM Win32_OperatingSystem");
System.Management.ManagementScope MyScope=new ManagementScope();
ManagementObjectSearcher MySearch=new ManagementObjectSearcher(MyScope,MyQuery);
ManagementObjectCollection MyCollection=MySearch.Get();
string StrInfo="";
foreach(ManagementObject MyObject in MyCollection)
{
StrInfo=MyObject.GetText(TextFormat.Mof);
}
string InstallDate=StrInfo.Substring(StrInfo.LastIndexOf("InstallDate")+15,14);
string LastBootUpTime=StrInfo.Substring(StrInfo.LastIndexOf("LastBootUpTime")+18,14);
string a =InstallDate;
string b =LastBootUpTime;
 
 
----------------------------------------------------------------------------------------------------------------
 
ShineingShare
 
在台灣的高速雲端
完全免費
不須註冊帳號
無限檔案空間
無下載流量限制
arrow
arrow
    文章標籤
    C#
    全站熱搜
    創作者介紹
    創作者 Roy Lai 的頭像
    Roy Lai

    Roy Lai

    Roy Lai 發表在 痞客邦 留言(0) 人氣()