在Windows系统上以C++打印出当前活动用户的环境变量,代码如下(QT环境): [cpp] view plain copy void getEnvironmentVariables() { DWORD sessionId = WTSGetActiveConsoleSessionId(); qIn Read More
posted @ 2017-08-06 23:49 findumars Views(745) Comments(0) Diggs(0)
首先,对“活动用户”的定义是,当前拥有桌面的用户。对于Windows XP及其以后的系统,即使是可以多个用户同时登录了,拥有桌面的也仅仅只有一个。 如果系统级服务调用Windows API来获取注册表键值的时候,直接以HKEY_CURRENT_USER为参数,则取到的并不是活动用户的注册表信息,而是 Read More
posted @ 2017-08-06 23:48 findumars Views(2369) Comments(0) Diggs(0)
原文地址:https://segmentfault.com/a/1190000003063859 同步IO和异步IO,阻塞IO和非阻塞IO分别是什么,到底有什么区别?不同的人在不同的上下文下给出的答案是不同的。所以先限定一下本文的上下文。 本文讨论的背景是Linux环境下的network IO。 一 Read More
posted @ 2017-08-06 22:42 findumars Views(286) Comments(0) Diggs(0)
std::wstring ws=L"kkkk"; int il=ws.length(); int ia=sizeof(ws); int ib=sizeof("dddd"); int ic=sizeof(L"kkkk");输出为 il=4,ia=32,ib=5,ic=10为什么ia=32 ?wstri Read More
posted @ 2017-08-06 22:04 findumars Views(1155) Comments(0) Diggs(0)
unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls; type TForm1 = class Read More
posted @ 2017-08-06 21:24 findumars Views(1168) Comments(0) Diggs(0)