Вниз
Скачать: CL | DM;

Как определить имя компьютера?   Найти похожие ветки 

 
Term ©   (2003-10-21 12:04) [0]

Как определить имя компьютера?


 
Skier ©   (2003-10-21 12:05) [1]

API GetComputerName(...)


 
Term ©   (2003-10-21 12:21) [2]

а можно прмерчик, а то чтото я в своём справочнике функций её не нашёл...


 
Skier ©   (2003-10-21 12:22) [3]

The GetComputerName function retrieves the computer name of the current system. This name is established at system startup, when it is initialized from the registry.

BOOL GetComputerName(

LPTSTR lpBuffer, // address of name buffer
LPDWORD nSize // address of size of name buffer
);


Parameters

lpBuffer

Points to a buffer to receive the null-terminated character string containing the computer name.

nSize

Points to a variable that specifies the maximum size, in characters, of the buffer. This value should be large enough to contain MAX_COMPUTERNAME_LENGTH + 1 characters.



Return Values

If the function succeeds, the return value is nonzero and the variable represented by the nSize parameter contains the number of characters copied to the destination buffer, not including the terminating null character.


 
Илайдж ©   (2003-10-21 12:26) [4]


function GetMyComputerName:String;
var N:Cardinal;
Buf: array [0..MAX_COMPUTERNAME_LENGTH + 1] of AnsiChar;
begin
N:=SizeOf(Buf)-1;
Windows.GetComputerName(Buf, N);
Result:=PChar(@Buf[0]);
end;


 
Term ©   (2003-10-21 12:29) [5]


> Илайдж © (21.10.03 12:26) [4]

спасибо


 
Zergling ©   (2003-10-21 12:37) [6]

А тебе Skier © спасибо не будет. Будешь знать, как из Helpa справку на английском приводить ;-)))).


 
Skier ©   (2003-10-21 12:48) [7]

>Zergling © (21.10.03 12:37) [6]

> А тебе Skier © спасибо не будет.

Не очень-то и хотелось ! :)


 
Term ©   (2003-10-21 12:51) [8]

да ладно всем спасибо, я никого не хотел обижать и Skier"у я тоже благодарен, порой носом тоже полезно ткнуть, вследующий раз буду знать где лазить...
но примерчик конечно ценнее :))


 
Anatoly Podgoretsky ©   (2003-10-21 12:57) [9]

Skier © (21.10.03 12:48) [7]
Он это к тому, что не надо приводить текст, достаточно ссылки на тему справки, у него же есть она?



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.46 MB
Время: 0.016 c
1-98653
Virus
2003-10-17 08:23
2003.10.30
Как обоити все компоненты


1-98725
Dmitriy
2003-10-20 20:08
2003.10.30
Показ картинки в Hint e


14-98831
panov
2003-10-03 21:55
2003.10.30
Снова о DNS и SMTP


1-98699
S@b@k@.
2003-10-21 17:02
2003.10.30
Помогите со <B>String Grid</B>


14-98878
Igorek
2003-10-10 12:39
2003.10.30
Есть идея - универсальный парсер




   Наверх