计算机如何区分指令和数据_软件可以区分台式计算机和笔记本电脑吗?

计算机如何区分指令和数据

计算机如何区分指令和数据

can-software-differentiate-between-a-desktop-computer-and-a-laptop-00

Many software licenses are pretty restrictive when it comes to how, and where you can install a program, but just how good are those programs at determining what type of device they are installed on? Today’s SuperUser Q&A post has the answer to a curious reader’s question.

在如何以及在何处可以安装程序方面,许多软件许可证都具有严格的限制,但是这些程序在确定将它们安装在哪种设备上方面有多好? 今天的“超级用户问答”帖子回答了一个好奇的读者的问题。

Today’s Question & Answer session comes to us courtesy of SuperUser—a subdivision of Stack Exchange, a community-driven grouping of Q&A web sites.

今天的“问答”环节由SuperUser提供,它是Stack Exchange的一个分支,该社区是由社区驱动的Q&A网站分组。

Photo courtesy of Robert (Flickr).

照片由Robert(Flickr)提供

问题 (The Question)

SuperUser reader Abhi wants to know if software can actually differentiate between a desktop computer and a laptop:

超级用户阅读器Abhi想知道软件是否可以真正区分台式计算机和便携式计算机:

A license for CPU-intensive software like Pix4D says that it can be installed on two devices, but with one condition. Reading the fine print, it seems that one device can be a full-processing desktop/workstation whereas the second one must be a laptop or mobile device.

诸如Pix4D之类的CPU密集型软件的许可证表示,可以将其安装在两台设备上,但有一个条件。 阅读精美的文字后,似乎其中一台设备可以是完全处理的台式机/工作站,而第二台设备必须是笔记本电脑或移动设备。

How would the software know what type of device it is installed on? Are there giveaways in the hardware specifications for determining something like this (i.e. the presence of a battery)?

该软件如何知道安装在哪种设备上? 硬件规格中是否有赠品来确定类似的内容(即是否存在电池)?

Given that the software is fully functional on both devices, would this condition become irrelevant if I just buy a high-end laptop which is just as fast as the desktop?

鉴于该软件在两个设备上均能完全正常工作,如果我只购买与台式机一样快的高端笔记本电脑,这种情况会变得无关紧要吗?

Can software actually differentiate between a desktop computer and a laptop?

软件实际上可以区分台式计算机和便携式计算机吗?

答案 (The Answer)

SuperUser contributors abnev and Technik Empire have the answer for us. First up, abnev:

超级用户贡献者abnev和Technik Empire为我们找到了答案。 首先,abnev:

On Linux, you can run the following command:

在Linux上,您可以运行以下命令:

  • sudo dmidecode –string chassis-type

    sudo dmidecode –字符串机箱类型

On a laptop, this will return laptop, notebook, portable, or sub-notebook (depending on the manufacturer).

在笔记本电脑上,这将返回笔记本电脑,笔记本电脑,便携式或子笔记本电脑(取决于制造商)。

For Windows, refer to the following TechNet documentation to determine your computer chassis type: Identifying the Chassis Type of a Computer

对于Windows,请参阅以下TechNet文档来确定您的计算机机箱类型: 标识计算机的机箱类型

Followed by the answer from Technik Empire:

随后是Technik Empire的回答:

To add to the other answer here regarding Linux, Windows software can also access this information through various provided WinAPI methods/objects. One such example is Win32_ComputerSystem, which among others, has members like:

要在此处添加有关Linux的其他答案,Windows软件还可以通过各种提供的WinAPI方法/对象访问此信息。 Win32_ComputerSystem是一个这样的示例,除其他外,其成员如下:

can-software-differentiate-between-a-desktop-computer-and-a-laptop-01

Possible values include:

可能的值包括:

can-software-differentiate-between-a-desktop-computer-and-a-laptop-02

As for how Windows knows this, while I cannot say with certainty because I presently lack both the Windows source code and any official documentation links, I would say it is a simple matter of the hardware ID’s within the computer giving this information away to the operating system.

至于Windows如何知道这一点,虽然我不能确定地说是因为我目前缺少Windows源代码和任何官方文档链接,但我想说这是计算机中硬件ID的简单问题,可以将这些信息提供给操作人员。系统。

Since Windows has a massive partner network that submits their drivers directly to Microsoft (for driver updates via Windows Update and “standard” drivers to include with installation media), it is pretty easy for Windows to figure out precisely what kind of computer you have it installed on. Just by the CPU ID alone, you could determine whether it is a desktop computer or a laptop.

由于Windows具有庞大的合作伙伴网络,可以直接将其驱动程序提交给Microsoft(用于通过Windows Update进行驱动程序更新以及安装介质中包含的“标准”驱动程序),因此Windows可以很容易地准确地确定您拥有的计算机类型安装在。 仅凭CPU ID ,就可以确定它是台式计算机还是笔记本电脑。



Have something to add to the explanation? Sound off in the comments. Want to read more answers from other tech-savvy Stack Exchange users? Check out the full discussion thread here.

有什么补充说明吗? 在评论中听起来不错。 是否想从其他精通Stack Exchange的用户那里获得更多答案? 在此处查看完整的讨论线程

翻译自: https://www.howtogeek.com/241706/can-software-differentiate-between-a-desktop-computer-and-a-laptop/

计算机如何区分指令和数据

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值