关于函数“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()的更多相关文章

  1. Windows API 函数列表 附帮助手册

    所有Windows API函数列表,为了方便查询,也为了大家查找,所以整理一下贡献出来了. 帮助手册:700多个Windows API的函数手册 免费下载 API之网络函数 API之消息函数 API之 ...

  2. POCO库——Foundation组件之核心Core

    核心Core: Version.h:版本控制信息,宏POCO_VERSION,值格式采用0xAABBCCDD,分别代表主版本.次版本.补丁版本.预发布版本: Poco.h:简单地包含了头文件Found ...

  3. asp.net中获取本机的相关信息!(CPU、内存、硬盘序列号等)

    // 注意:首先要在项目bin目录中添加引用 System.Management using System;using System.Collections.Generic;using System. ...

  4. 转:Delphi 6 实用函数

    来自: daocaoren0824, 时间: -- ::, ID: 再给你一份 程序员实用函数 {▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎} {▎ ▎} {▎ 大 ...

  5. ManagementClass类解析和C#如何获取硬件的相关信息

    在.NET的项目中,有时候需要获取计算机的硬件的相关信息,在C#语言中需要利用ManagementClass这个类来进行相关操作. 现在先来介绍一下ManagementClass类,首先看一下类的继承 ...

  6. 你想的到想不到的 javascript 应用小技巧方法

    javascript 在前端应用体验小技巧继续积累. 事件源对象 event.srcElement.tagName event.srcElement.type 捕获释放 event.srcElemen ...

  7. javascript小技巧

    事件源对象 event.srcElement.tagName event.srcElement.type 捕获释放 event.srcElement.setCapture();  event.srcE ...

  8. C#调用windows API的一些方法

    使用C#调用windows API(从其它地方总结来的,以备查询) C#调用windows API也可以叫做C#如何直接调用非托管代码,通常有2种方法: 1.  直接调用从 DLL 导出的函数. 2. ...

  9. C#常用操作类库五(电脑操作类)

    /// <summary> /// Computer Information /// </summary> public class ComputerHelper { publ ...

随机推荐

  1. Flask图书管管理表

    后端的读写 from flask import Flask,render_template,request from flask_sqlalchemy import SQLAlchemy #导入时间模 ...

  2. 人人开源分模块,非原生html报错,很难查找问题所在,有vue语法

    <!DOCTYPE html> <html> <head> <title>学生表</title> #parse("sys/head ...

  3. Zookeeper学习笔记1

    参考:从Paxos到Zookeeper分布式一致性原理与实践 从ACID到CAP/BASE ACID 事务(Transaction),一般是指要做的或所做的事情.在计算机术语中是指访问并可能更新数据库 ...

  4. python 指定日期图片文件删除

    手机使用python操作图片文件 起因 前几天去国图拍了一本书,一本心理学方面的书,也许你问我为什么不去买一本,或者去网上找pdf. 其实吧,关于心理学方面的书可以说在市面上一抓就是一堆,至于拍这本书 ...

  5. Boost property_tree解析json

    使用Boost property_tree解析json 之前使用jsoncpp解析json,现在才知道boost就有解析的库,学习一下吧 property_tree可以解析xml,json,ini,i ...

  6. unity开发笔记

    debug代码       Debug.Log("普通信息");         Debug.LogWarning("警告信息");         Debug ...

  7. epoll机制详解

    epoll机制详解 大牛的详解 epoll详解 什么是epoll? epoll是为处理大批量句柄而作了改进的poll, 是性能最好的多路I/O就绪通知方法; 只有三个系统调用: epoll_creat ...

  8. webstorm加载项目卡死在scanning files to index

    今天用webstorm导入项目时,需要加载node-modules文件夹,导致webstorm非常卡,页面提示scanning files to index... 网上搜到办法,记录下: 说明: 在n ...

  9. $Django 站点:样式--文章--分类文章--文章详情--文章评论点赞--文章评论点赞统计(数据库优化)

    <h3>个人站点下的</h3> 知识点 url (r'(?P<username>\w+)/p/(?P<id>\d+)', xiangxi,name='x ...

  10. PHP导入导出csv文件 Summer-CSV

    2017年11月9日09:25:56 根据项目实践总结的一个类文件, mac/win下没乱码 简体中文 默认从gb2312转到utf-8 https://gitee.com/myDcool/PHP-C ...