antiblock
Cyphriun
  • Chatbox

    You don't have permission to chat.
    Load More
Sign in to follow this  
V¡®u§

Obter nome do computador (C/C++)

1 post in this topic

Imagem colocada

Logo abaixo segue o código de um pequeno programa feito em C++ Builder 2010 que captura o nome do computador:


//---------------------------------------------------------------------------

#include
#pragma hdrstop

#include "Unit1.h"
#include
#include
#include
#include "dstring.h"

//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}

AnsiString GetLocalComputerName() {
TCHAR chrComputerName[MAX_COMPUTERNAME_LENGTH + 1];
AnsiString strRetVal;
DWORD dwBufferSize = MAX_COMPUTERNAME_LENGTH + 1;

if(GetComputerName(chrComputerName,&dwBufferSize)) {
strRetVal = chrComputerName;
} else {
strRetVal = "";
}

return(strRetVal);
}


//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
ShowMessage(GetLocalComputerName());
Memo1->Lines->Add(GetLocalComputerName());
}
//---------------------------------------------------------------------------

Download Source:

http://www.4shared.com/rar/ItH2uTub/Source_-Cyber-Gamers.html

http://www.badongo.com/file/26694485

http://rapidshare.com/files/1566564959/Source_-Cyber-Gamers.rar

http://turbobit.net/hqgl8qqpz443.html

http://ul.to/g459c0au

http://www.ziddu.com/download/19053658/Source-Cyber-Gamers.rar.html

http://www9.zippyshare.com/v/19635170/file.html

Share this post


Link to post
Share on other sites
antiblock
Elveron

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this