vc编程查找计算机运行记录_如何查找计算机的正常运行时间和安装日期

vc编程查找计算机运行记录

vc编程查找计算机运行记录

computer-uptime

“My computer’s been running for 100 days without a reboot!” “I haven’t reinstalled Windows in five years!” Geeks love to brag about this stuff. Here’s how to find your uptime and installation date on Windows, Linux, and Mac.

“我的计算机已经运行了100天,没有重新启动!” “五年来我没有重新安装Windows !” 极客们喜欢吹牛。 这是在Windows,Linux和Mac上查找正常运行时间和安装日期的方法。

“Uptime” is a geeky term that refers to how long a system has been “up” and running without a shut down or restart. It’s a bigger deal on servers than typical desktops.

“正常运行时间”是一个令人讨厌的术语,指的是系统已启动并运行了多长时间而没有关闭或重新启动。 与典型的台式机相比,服务器上的交易量更大。

Windows-正常运行时间 (Windows — Uptime)

Your Windows system’s uptime is displayed in the Task Manager. Right-click the taskbar and select Task Manager or press Ctrl+Shift+Escape to open it.

Windows系统的正常运行时间显示在任务管理器中 。 右键单击任务栏,然后选择“任务管理器”,或按Ctrl + Shift + Escape将其打开。

On Windows 8, click the Performance tab and look under “Up time” at the bottom of the window.

在Windows 8上,单击“性能”选项卡,然后在窗口底部的“正常运行时间”下查看。

find-uptime-on-windows-8

On Windows 7 or Vista, you’ll also find this information on then Performance tab — look for “Up time” under System.

在Windows 7或Vista上,您还可以在“性能”选项卡上找到此信息-在“系统”下查找“正常运行时间”。

find-up-time-on-windows-7

Windows-安装日期 (Windows — Installation Date)

You can find the date you installed Windows with the systeminfo command. First, open the Command Prompt — press Windows Key + R, type cmd into the Run dialog, and press Enter. Type the following command into the Command Prompt window and press Enter (note that you must type Original with the capital letter on older versions of Windows).

您可以使用systeminfo命令找到安装Windows的日期。 首先,打开命令提示符-按Windows键+ R,在“运行”对话框中键入cmd ,然后按Enter。 在“命令提示符”窗口中键入以下命令,然后按Enter键(请注意,在较早版本的Windows上,必须键入Original并使用大写字母)。

systeminfo | find /i “Original”

systeminfo | 找到/ i“原始”

If you are using Windows 7 or Vista you might need to use this line instead:

如果您使用的是Windows 7或Vista,则可能需要使用以下代码:

systeminfo | find “Original”

systeminfo | 找到“原始”

find-windows-installation-date

Linux —正常运行时间 (Linux — Uptime)

Many Linux utilities display your uptime, from the “top” command to graphical system information utilities.

“ top”命令到图形系统信息实用程序,许多Linux实用程序都会显示您的正常运行时间。

There’s also a dedicated uptime command to display this information. To see your uptime on Linux, open a terminal window, type the following command, and press Enter:

还有一个专用的正常运行时间命令来显示此信息。 要在Linux上查看正常运行时间,请打开终端窗口,键入以下命令,然后按Enter:

uptime

正常运行时间

find-uptime-on-linux-system

Linux —安装日期 (Linux — Installation Date)

There’s no one standard way to see when you installed your Linux system. What you want to do is find a file that hasn’t been modified since you installed Linux and see when it was created.

没有什么标准方法可以查看何时安装Linux系统。 您要做的是找到自安装Linux以来未修改过的文件,并查看它的创建时间。

For example, Ubuntu’s installer creates log files at /var/log/installer when you install it. You can check when this directory was created to see when the Ubuntu system was installed. To do this, open a terminal window and run the following command:

例如,Ubuntu的安装程序在安装时会在/ var / log / installer中创建日志文件。 您可以检查何时创建此目录,以查看何时安装了Ubuntu系统。 为此,请打开一个终端窗口并运行以下命令:

ls -ld /var/log/installer

ls -ld / var / log / installer

The time and date the folder was created is when you installed your Linux system.

创建文件夹的时间和日期是安装Linux系统的时间。

find-ubuntu-installation-date

You might also try looking at the /lost+found folder, which is generally created when you install Linux and set up your drive. This should work on other Linux distributions, too:

您也可以尝试查看/ lost + found文件夹,该文件夹通常是在安装Linux并设置驱动器时创建的。 这也应该适用于其他Linux发行版

ls -ld /lost+found

ls -ld / lost + found

find-linux-system-installation-date

Mac OS X-正常运行时间 (Mac OS X — Uptime)

Your Mac system displays its uptime in the System Information window. Click the Apple menu icon on the bar at the top of your screen, hold down the Option key, and click System Information. Scroll down in the left pane, select Software, and look for “Time since boot” to see your Mac’s uptime.

您的Mac系统在“系统信息”窗口中显示其正常运行时间。 单击屏幕顶部栏上的Apple菜单图标,按住Option键,然后单击“系统信息”。 在左窗格中向下滚动,选择“软件”,然后查找“自启动以来的时间”以查看Mac的正常运行时间。

find-mac-os-x-uptime

You can also use the uptime command on a Mac, too. Press Command + Space, type Terminal, and press Enter to open a terminal window. Run the uptime command.

您也可以在Mac上使用正常运行时间命令。 按Command + Space,输入Terminal ,然后按Enter打开终端窗口。 运行正常运行时间命令。

find-mac-os-x-uptime-in-terminal

Mac OS X-安装日期 (Mac OS X — Installation Date)

You should be able to find when your Mac OS X system was installed from its install.log file. First, open the Console application. Press Command + Space, type Console, and press Enter to open it. Expand the /var/log folder in the sidebar, scroll down, and click install.log in the list. Scroll up to the top of the install.log file and look at the oldest date there.

您应该能够从install.log文件中找到安装Mac OS X系统的时间。 首先,打开控制台应用程序。 按Command + Space ,键入Console ,然后按Enter将其打开。 展开侧栏中的/ var / log文件夹,向下滚动,然后在列表中单击install.log。 向上滚动至install.log文件的顶部,然后查看那里的最早日期。

If you’ve been using your Mac for a while, there may be archived install.log files with the names install.log.0.gz, install.log.1.gz, and so on. Open the oldest one, which is the one that has the highest number in its name.

如果您使用Mac已有一段时间,则可能存在名为install.log.0.gz,install.log.1.gz等的已归档install.log文件。 打开最旧的,即名称中编号最高的那个。

find-mac-os-x-installation-date


This information is interesting, especially when you compare it with other people’s computers. There’s not much practical to be done with this information, of course — it’s mostly for bragging rights.

此信息很有趣,尤其是当您将其与其他人的计算机进行比较时。 当然,使用此信息并没有太多实际操作-主要是为了吹牛。

Image Credit: Trevor Manternach on Flickr

图片来源: Flickr上的Trevor Manternach

翻译自: https://www.howtogeek.com/194186/bragging-rights-how-to-find-your-computers-uptime-and-installation-date/

vc编程查找计算机运行记录

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值