![]() |
| ||
|
|
Новости |
Поиск |
FAQ |
Статьи |
Книги |
Новости VCL
| | Форумы ЧАТ |
Орешник |
|
| |||
| |||
« предыдущая ветвь | форум | следующая ветвь »
Какай командой узнать сетевое имя компа?
саша © (2002-10-14 06:50:00)Ответте пожалуста.
саша (2002-10-15 07:56:00) [1]Всем спасибо
turusov (2002-10-14 11:15:00) [2]function TNsDublicateApplication.GetUserName : String;
var
pcUser : PChar;
dwUSize : DWORD;
begin
dwUSize := 21; // user name can be up to 20 characters
GetMem( pcUser, dwUSize ); // allocate memory for the string
try
if Windows.GetUserName( pcUser, dwUSize ) then
Result := pcUser
finally
FreeMem( pcUser ); // now free the memory allocated for the string
end;
end;
function TNsDublicateApplication.GetComputerName : String;
var
pcComputer: PChar;
dwCSize : DWORD;
begin
dwCSize := MAX_COMPUTERNAME_LENGTH + 1;
GetMem( pcComputer, dwCSize ); // allocate memory for the string
try
if Windows.GetComputerName( pcComputer, dwCSize ) then
Result := pcComputer;
finally
FreeMem(pcComputer); // now free the memory allocated for the string
end;
end;
Кулюкин Олег (2002-10-14 09:03:00) [3]GetComputerName?
sask (2002-10-14 09:01:00) [4]GetHostName / GetComputerName