C++ GetComputerName()
关于函数“GetComputerName()”,参考:https://msdn.microsoft.com/en-us/library/windows/desktop/ms724295(v=vs.85).aspx
关于“Computer Names”,参考:https://msdn.microsoft.com/en-us/library/windows/desktop/ms724220(v=vs.85).aspx
代码摘自“Getting System Information”,参考:https://msdn.microsoft.com/en-us/library/windows/desktop/ms724426(v=vs.85).aspx
关于“Windows Data Types”,参考:https://msdn.microsoft.com/en-us/library/windows/desktop/aa383751(v=vs.85).aspx
IDE: Code::Blocks
操作系统:Windows 7 x64
#include <stdio.h>
#include <tchar.h>
#include <windows.h> #define INFO_BUFFER_SIZE (MAX_COMPUTERNAME_LENGTH + 1) int main()
{
CHAR infoBuf[INFO_BUFFER_SIZE];
DWORD bufCharCount = INFO_BUFFER_SIZE; // Get and display the name of the computer.
if( GetComputerName( infoBuf, &bufCharCount ) ) {
_tprintf( "The NetBIOS name of the local computer is %s \n", infoBuf );
}
else {
_tprintf( "Get NetBIOS name of the local computer failed with error %lu \n", GetLastError() );
} return ;
}
C++ GetComputerName()的更多相关文章
- Windows API 函数列表 附帮助手册
所有Windows API函数列表,为了方便查询,也为了大家查找,所以整理一下贡献出来了. 帮助手册:700多个Windows API的函数手册 免费下载 API之网络函数 API之消息函数 API之 ...
- POCO库——Foundation组件之核心Core
核心Core: Version.h:版本控制信息,宏POCO_VERSION,值格式采用0xAABBCCDD,分别代表主版本.次版本.补丁版本.预发布版本: Poco.h:简单地包含了头文件Found ...
- asp.net中获取本机的相关信息!(CPU、内存、硬盘序列号等)
// 注意:首先要在项目bin目录中添加引用 System.Management using System;using System.Collections.Generic;using System. ...
- 转:Delphi 6 实用函数
来自: daocaoren0824, 时间: -- ::, ID: 再给你一份 程序员实用函数 {▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎} {▎ ▎} {▎ 大 ...
- ManagementClass类解析和C#如何获取硬件的相关信息
在.NET的项目中,有时候需要获取计算机的硬件的相关信息,在C#语言中需要利用ManagementClass这个类来进行相关操作. 现在先来介绍一下ManagementClass类,首先看一下类的继承 ...
- 你想的到想不到的 javascript 应用小技巧方法
javascript 在前端应用体验小技巧继续积累. 事件源对象 event.srcElement.tagName event.srcElement.type 捕获释放 event.srcElemen ...
- javascript小技巧
事件源对象 event.srcElement.tagName event.srcElement.type 捕获释放 event.srcElement.setCapture(); event.srcE ...
- C#调用windows API的一些方法
使用C#调用windows API(从其它地方总结来的,以备查询) C#调用windows API也可以叫做C#如何直接调用非托管代码,通常有2种方法: 1. 直接调用从 DLL 导出的函数. 2. ...
- C#常用操作类库五(电脑操作类)
/// <summary> /// Computer Information /// </summary> public class ComputerHelper { publ ...
随机推荐
- NoClassDefFound Error: com/fasterxml/jackson/annotation/JsonAutoDetect
少了 jackson-annotation https://blog.csdn.net/qq_36497454/article/details/80461676
- android4.4之后的HttpUrlConnection的实现是基于okhttp
首先看HttpUrlConnection使用 URL url = new URL("http://www.baidu.com"); HttpURLConnection urlCon ...
- python,类和对象练习
''' 按照一下要求定义一个游乐园门票类,并尝试计算2个成人+1个小孩子平日票价 1.平日票价100元 2.周末票价为平日票价120% 3.儿童半价 ''' class Ticket: pice = ...
- [转] Implementing a CNN for Text Classification in TensorFlow
Github上的一个开源项目,文档讲得极清晰 Github - https://github.com/dennybritz/cnn-text-classification-tf 原文- http:// ...
- Vue获取事件源
设置事件源 <label :data-weight="item1.EvaluateWeight" @click='radioClick' :data-id="ite ...
- 椭圆曲线密码学ECC
椭圆曲线密码学(Elliptic curve cryptography),简称ECC,是一种建立公开密钥加密的算法,也就是非对称加密.类似的还有RSA,ElGamal算法等.ECC被公认为在给定密 ...
- 876. Middle of the Linked List
1. 原始题目 Given a non-empty, singly linked list with head node head, return a middle node of linked li ...
- Shell命令和技巧
监控命令(每2秒运行一次) watch "ls -larth" 使用一个端口杀死程序 sudo fuser -k 8000/tcp 限制以下命令的内存使用 ulimit -Sv 1 ...
- 组合权限查询 SQL,UniGUI
组合权限查询 SQL,UniGUI: name ,View, New, Edit, Dele 表 获取 name 的 授权. 项目 1 0 0 ...
- linux系统网络相关问题
暂时将你的 eth0 这张网络卡的 IP 设定为 192.168.1.100 ,如何进行? ifconfig eth0 192.168.1.100 我要增加一个路由规则,以 eth0 连接 192.1 ...