如题,主要是想知道如何得到一个程序的安装时间然后去算这个程序用了多少天,如果超出设定的天数就提示需要注册.....

解决方案 »

  1.   

    在安装部署中通过安装类操作注册表。添加时间项
    或写入XML等配置文件
      

  2.   

    InstallDate
    Data type: string
    Access type: Read-only
    Starting with Windows XP this property is no longer supported for Win32_Product. Instead, use the InstallDate2 property, which is in the WMI CIM_DATETIME format.Windows 2000:  Date that this product is installed on the system. This property does not need a value to indicate that the object is installed.
    InstallDate2
    Data type: datetime
    Access type: Read-only
    Date that this product was installed on the system. This property does not require a value to indicate that the object is installed. For more information about WMI dates and times, see Date and Time Format.Windows 2000:  This property is not available.http://msdn.microsoft.com/en-us/library/aa394378(VS.85).aspx
      

  3.   

    1.XML配置文件是否不安全是否会被用户删除或改写
    2.如果写入注册表后,用户试用期到删除该键,再卸载程序再重装.好像还是可以继续试用.