Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 297
  • Last Modified:

Get USERID Using C++

What is the syntax to get the userid from a windows based system using c++ code?
0
eddiepardon
Asked:
eddiepardon
1 Solution
 
jkrCommented:
Either

char* pszUserID = getenv("USERNAME");

or

char acUserName[256];

GetUserName(acUserName,sizeof(acUserName));
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now