Einzelnen Beitrag anzeigen

WojTec

Registriert seit: 17. Mai 2007
480 Beiträge
 
Delphi XE6 Professional
 
#12

Re: Set hostname - can't write to registry

  Alt 7. Apr 2012, 17:06
I have:

Delphi-Quellcode:
// Set DNS and NetBIOS
SetComputerName(ComputerNamePhysicalDnsHostname, FHostName);
// Set NetBIOS
SetComputerName(ComputerNamePhysicalNetBIOS, FComputerName);
My SetComputerName():

Delphi-Quellcode:
function SetComputerName(const AType: TComputerNameFormat; const AName: string): Boolean;
var
  Name: array[0..MAX_COMPUTERNAME_LENGTH + 1] of Char;
begin
  StrPCopy(Name, AName);
  Result := SetComputerNameEx(AType, Name);
end;
It seems there is some strange problem with permissions...

Geändert von WojTec ( 7. Apr 2012 um 17:10 Uhr)
  Mit Zitat antworten Zitat