Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Network domain or workgroup
Message
De
23/12/2008 14:29:24
 
 
À
23/12/2008 08:50:05
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01369239
Message ID:
01369458
Vues:
9
>>>>
>>>>? Getenv("USERDNSDOMAIN")
>>>>? Getenv("USERDOMAIN")
>>>>
>>>hi Hugo..
>>>
>>>well.. I already try both here... the first one brings me null result
>>>
>>>the second brings the name of this computer on the LAN.. instead of the name of domain (or network workgroup name)
>>
>>Unless your computer is part of a Windows Server domain, its "domain" will be your local computer.
>
>my PC isn't part of a Windows Server domain
>
>so, if you meant ? Getenv("DOMAIN")... brought me NULL value

If your computer isn't part of a Windows Server domain, then its "domain" is the same as the PC name, which you can get from SYS( 0 ). If you're interested in the workgroup name, I don't know how to get that.

On my machine, not part of a Windows Server domain, the USERDOMAIN environment variable is the same as the machine name.

Some environment variables such as USERDNSDOMAIN are set only when the computer is made a member of a Windows Server domain. Otherwise, they aren't created at all, which is why GETENV() is returning the empty string (not NULL).

In general, relying on environment variables for this sort of thing is unreliable. You're better off with an API call - unfortunately, I don't know exactly which one you'd need, I think others on this thread have pointed out how to do this.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform