Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
1631 connectés 

  FORUM HardWare.fr
  Programmation
  Java

  Windows USer/Domain

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

Windows USer/Domain

n°1154905
Shine6
Posté le 20-07-2005 à 15:52:04  profilanswer
 


Hello,
 
Quelqu'un sait si il existe un moyen de récupérer le user/domain courrant sous WINdows XP avec java 1.5 ?
 
Merci d'avance  :p

mood
Publicité
Posté le 20-07-2005 à 15:52:04  profilanswer
 

n°1155157
Nicolas_75
Posté le 20-07-2005 à 17:37:54  profilanswer
 


Bonjour,
 
As-tu jeté un oeil à la documentation de System.getProperties() ?
 

public static Properties getProperties()
 
Determines the current system properties.  
First, if there is a security manager, its checkPropertiesAccess method is called with no arguments. This may result in a security exception.  
 
The current set of system properties for use by the getProperty(String) method is returned as a Properties object. If there is no current set of system properties, a set of system properties is first created and initialized. This set of system properties always includes values for the following keys: Key Description of Associated Value  
java.version Java Runtime Environment version  
java.vendor Java Runtime Environment vendor  
java.vendor.url Java vendor URL  
java.home Java installation directory  
java.vm.specification.version Java Virtual Machine specification version  
java.vm.specification.vendor Java Virtual Machine specification vendor  
java.vm.specification.name Java Virtual Machine specification name  
java.vm.version Java Virtual Machine implementation version  
java.vm.vendor Java Virtual Machine implementation vendor  
java.vm.name Java Virtual Machine implementation name  
java.specification.version Java Runtime Environment specification version  
java.specification.vendor Java Runtime Environment specification vendor  
java.specification.name Java Runtime Environment specification name  
java.class.version Java class format version number  
java.class.path Java class path  
java.library.path List of paths to search when loading libraries  
java.io.tmpdir Default temp file path  
java.compiler Name of JIT compiler to use  
java.ext.dirs Path of extension directory or directories  
os.name Operating system name  
os.arch Operating system architecture  
os.version Operating system version  
file.separator File separator ("/" on UNIX)  
path.separator Path separator (":" on UNIX)  
line.separator Line separator ("\n" on UNIX)  
user.name User's account name  
user.home User's home directory  
user.dir User's current working directory


 
Nicolas

n°1155172
Shine6
Posté le 20-07-2005 à 17:53:01  profilanswer
 


Merci,
 
Ona  bien le user avec :
 
System.out.println(System.getProperty("user.name" ));
 
Par contre y a pas le domaine ...

n°1155348
the real m​oins moins
Posté le 20-07-2005 à 22:18:21  profilanswer
 

[:rechercher]
 
euh ué par contre pour le domaine c'est autre chose :whistle:


Message édité par the real moins moins le 20-07-2005 à 22:19:03
n°1155582
madshark
Posté le 21-07-2005 à 09:56:11  profilanswer
 

si c'est que pour du WinXP, y'a la variable d'environnement USERDOMAIN ou USERDNSDOMAIN, nan?


Message édité par madshark le 21-07-2005 à 09:57:11

---------------
°o° It only hurts if you survive  °o°
n°1165240
Shine6
Posté le 29-07-2005 à 20:06:29  profilanswer
 

madshark a écrit :

si c'est que pour du WinXP, y'a la variable d'environnement USERDOMAIN ou USERDNSDOMAIN, nan?


 
Exact, ca peut être une solution. Mais je suis sur que java propose une méthode qui donne ça. Surement dans les classes liées aux aspects réseau ...


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  Java

  Windows USer/Domain

 

Sujets relatifs
upload ecrire user choisit dossier ou il stockeuser controle et propriété
éxucution directe d'une macro excel sous windowscopier le journal des événements de Windows dans une base de donnée Ac
Programmation C/C++ sous Windowswindows et C++
Forcer la MASTER en Mode SINGLE USERstyle CSS dans user web control
CVS Windowschanger de user pour lancer un processus
Plus de sujets relatifs à : Windows USer/Domain


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR