get the computer name

September 28, 2008 by admin  
Filed under C

This example will get the computer name

#include <stdio.h>
#include <windows.h>
#include <conio.h>

void main(void)
{
char szBuffer[256];
DWORD dwNameSize=256;
//get the computer name
GetComputerName(szBuffer, &dwNameSize);
//print name
printf(”%s \n”,szBuffer);
getch();

}

Related posts:

  1. get the type of disk #include #include #include int main() { char szBuffer[MAX_PATH+100]; DWORD dwLogicalDrives...
  2. change computer name change computer name using Visual Basic Declare Function SetComputerName Lib...
  3. Absread example #include #include #include #include int main(void) { unsigned char buffer[512];...
  4. Abswrite example #include #include #include #include int main(void) { unsigned char buffer[512];...
  5. Blinking text #include int main() { int color; textattr(128 + 10); cprintf(”This...

Related posts brought to you by Yet Another Related Posts Plugin.

Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!