Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Keys

Empfohlene Antworten

Veröffentlicht

Hi,

kann mir einer von euch sagen, wie man die einzelnen Keys bei einer Property-Datei ansprechen kann?

Hab das in meinem IHK-Projekt gemacht, bin mir aber nicht mehr ganz sicher.

Zuerst brauchst du ein Objekt der Klasse Properties (könnte in der util Bibliothek liegen).

Dann gibt es da Methoden wie z.B. getProperty(Key) oder so ähnlich. Eine andere Methode gibt dir auch eine Enumeration aller Keys zurück, die du dann in einer Schleife abarbeiten könntest.

Wenn du noch Fragen hast, meld dich, dann such dir mal ein Beispiel.

snupi

so sieht das bei mir aus. Aber ich will nicht alle auslesen, sondern nur einzelen.

/** User - Einstellungen im einem Property-File */

public void userProperties()

{

try

{

FileOutputStream propOutFile = new FileOutputStream(filenameuser);

userout = new Properties();

userout.setProperty("Speicherort",tfspeicherortinhalt);

userout.setProperty("Protokoll",tfprotokollinhalt);

userout.setProperty("SGML",tfsgmlinhalt);

userout.setProperty("Dokumentation","cbdokumentationinhalt");

userout.setProperty("Ergebnistyp","cbergebnistypinhalt");

userout.setProperty("Modus","cbmodusinhalt");

userout.store(propOutFile, "Einstellungen für die Dokumentationsgenerierung");

propOutFile.close();

FileInputStream propInFile = new FileInputStream(filenameuser);

userin = new Properties();

userin.load(propInFile);

propInFile.close();

Enumeration propNames = userin.propertyNames();

while (propNames.hasMoreElements())

{

String nextKey = (String) propNames.nextElement();

//System.out.println (nextKey + " = " + userin.getProperty (nextKey, "[not found]"));

}

}

catch (FileNotFoundException e)

{

System.err.println("Kann nicht gefunden werden" + filenameuser);

}

catch (IOException e)

{

System.err.println("Eingabe/Ausgabe Fehler!");

}

}

Ich glaube, ich vestehe dein Problem noch nicht.

Wenn du nur einen Wert auslesen willst, musst du doch nur z.B.

userin.getProperty(Speicherort)

angeben.

snupi

das habe ich schon probiert. Das geht aber leider nicht.

Versteh ich nicht. Bei mir klappt das gut.

ich probiere es nochmal.

trotzdem Danke

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.