AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Set hostname - can't write to registry

Ein Thema von WojTec · begonnen am 5. Apr 2012 · letzter Beitrag vom 7. Apr 2012
Antwort Antwort
Seite 2 von 2     12   
Benutzerbild von jaenicke
jaenicke

Registriert seit: 10. Jun 2003
Ort: Berlin
9.358 Beiträge
 
Delphi 11 Alexandria
 
#11

AW: Re: Set hostname - can't write to registry

  Alt 7. Apr 2012, 16:43
Hm, now return True, but names are not changed after restart
For me it seems as if you look at the wrong position. Following the documentation only the NETBIOS name is changed by this function. This is not what you see in the system settings.

So you will have to follow the hint in the documentation:
Zitat:
To set the DNS host name or the DNS domain name, call the SetComputerNameEx function.
I guess you meant what SetComputerNameEx does.
Sebastian Jänicke
Alle eigenen Projekte sind eingestellt, ebenso meine Homepage, Downloadlinks usw. im Forum bleiben aktiv!
  Mit Zitat antworten Zitat
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
Antwort Antwort
Seite 2 von 2     12   


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 22:00 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz