PDA

View Full Version : [C#] getProperty


chiara3.0
10-12-2008, 10:15
In C# quale è il modo equivalente di fare (in quale ns cercare):

String a = System.getProperty(JClass.class.getName()+".klk");

dove getProperty fa "Gets the system property indicated by the specified key. First, if there is a security manager, its checkPropertyAccess method is called with the key as its argument. This may result in a SecurityException."

^TiGeRShArK^
10-12-2008, 13:25
In C# quale è il modo equivalente di fare (in quale ns cercare):

String a = System.getProperty(JClass.class.getName()+".klk");

dove getProperty fa "Gets the system property indicated by the specified key. First, if there is a security manager, its checkPropertyAccess method is called with the key as its argument. This may result in a SecurityException."

:mbe:
non ho capito la domanda...
se intendi chiedere se esiste un equivalente della classe Properties di java, beh...
no, non esiste...io me la sono riscritta perchè c'ero affezionato :asd:
Se intendi come accedere alle proprietà del sistema..
beh..
ci sono mille e mille modi diversi a seconda delle informazioni che vuoi reperire...
Il + semplice è forse tramite la classe Environment, ma col C# puoi anche accedere abbastanza facilmente alla WMI per ottenere praticamente qualsiasi informazione....