有些软件可以显示硬盘已使用XX个小时,哪位大侠知道如何读取? 
多多谢了,呵呵

解决方案 »

  1.   

    不知道,应该跟.net没啥关系的!
      

  2.   

    int   result   =   Environment.TickCount   &   Int32.MaxValue; 
    单位是毫秒哦。
    这里认为你系统启动时间就是硬盘工作时间,呵呵,和你要求的,应该就差一个开机到进入系统的时间
      

  3.   

    系统信息,你可以运行cmd.exe,然后敲入Systeminfo | more 命令来输出基本系统信息。其中有一项为System Boot Time,取到这个值,然后用now减去System Boot Time的值就是硬盘的运行时间了吧!
      

  4.   

    硬盘加电时间可以用系统启动时间来代替,差不多的using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;
    using System .Diagnostics ;namespace WindowsApplication273
    {
        public partial class Form1 : Form
        {
            PerformanceCounter PC = new PerformanceCounter("System", "System Up Time");
            public Form1()
            {
                InitializeComponent();            Timer T = new Timer();
                T.Interval = 1000;
                T.Tick += new EventHandler(T_Tick);
                T.Enabled = true;
            }        void T_Tick(object sender, EventArgs e)
            {
                float TotalSeconds = PC.NextValue();            this.Text = String.Format("硬盘已经使用了{0:0.0}小时", TotalSeconds / 60 / 60);
            }
        }
    }
      

  5.   

    LS几个都没理解到什么叫硬盘通电时间?这个只有读硬盘上的SMART才准确,有API的,查查应该可以读.
      

  6.   


    LZ只要求XX小时有必要那么精确么