小编Ang*_*Cub的帖子

获取主板序列号

我想将程序绑定到特定的计算机,为此我想使用主板的序列号作为唯一标识符。

虽然我可以找到一些 C# 和 Java 的例子,但我找不到任何可靠的 C++(我读过 WMI 可能会因硬件而失败),但肯定有办法在 C++ 中做到这一点吗?

编辑:换句话说,我想要的是一个简单而基本的许可系统。为了更清楚,下面是它的样子:

#define USER_SERIAL 123456789

double GetMotherBoardSerialNumber();
// ...

double currentSerial = GetMotherBoardSerialNumber();

if(currentSerial != USER_SERIAL) {
    exit 1;
}
Run Code Online (Sandbox Code Playgroud)

这显然不完美,但我没有任何服务器 atm 来设置帐户系统,因此这可能是一个临时解决方案。

c++ windows winapi hardware-id

6
推荐指数
2
解决办法
1万
查看次数

“getimagesize():SSL 操作失败,代码为 1”(仅限本地 Xampp)

getimagesize() 在 Xampp(本地 PC)中失败,尽管它在实时环境中工作正常。

根据错误消息,该问题似乎与证书配置有关。我根据本文创建了自签名证书:https://shellcreeper.com/how-to-create-valid-ssl-in-localhost-for-xampp/

这从 Apache 的错误日志中删除了 SSL 警告,但 getimage() 的问题仍然相同。

http如果我使用而不是传递图像的 URL https,则调用有效。

<?php
$file = "http://webtest.test/content/uploads/img.jpg";  // Will work
$file = "https://webtest.test/content/uploads/img.jpg"; // Will not work

// ...

$img_info = getimagesize($file);
if(!$img_info) {
  throw new Exception(__("The file type is not valid image (1)"));
}
?>
Run Code Online (Sandbox Code Playgroud)

收到错误:

PHP Warning:  getimagesize(): SSL operation failed with code 1. OpenSSL Error messages:\nerror:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed in \\xampp\\htdocs\\index.php on line 3, referer: https://webtest.test/
PHP Warning:  getimagesize(): Failed to enable …
Run Code Online (Sandbox Code Playgroud)

php xampp getimagesize

4
推荐指数
1
解决办法
1万
查看次数

标签 统计

c++ ×1

getimagesize ×1

hardware-id ×1

php ×1

winapi ×1

windows ×1

xampp ×1