简体   繁体   English

C / C ++如何在当前计算机上检查域名?

[英]C / C++ How to check domain name on current machine?

I am looking for C or C++ solution to check domain name on current machine just like CGI and $ENV{'HTTP_HOST'} does it. 我正在寻找C或C ++解决方案来检查当前计算机上的域名,就像CGI和$ ENV {'HTTP_HOST'}一样。

Thanks for any example, advice, resource I will appreciate all ;) 感谢您的任何示例,建议和资源,我将不胜感激;)

On linux, you may use hostname command. 在linux上,您可以使用hostname命令。

On windows, the solution is described here . 在Windows上, 此处描述了解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM