0

これが私のコードです:

try{
    if(fichadaHecha==false)
        {
            Element fichada = new Element("fichada");
                  //Nº TERMINAL
                  fichada.addContent(new Element("N_Terminal").setText("XX"));
                  //TARJETA
                  fichada.addContent(new Element("Tarjeta").setText(codOperario));
                  //FECHA
                  Date fechaFormatoFecha = new Date( );
                  fichada.addContent(new Element("Fecha").setText(formatoFecha.format(fechaFormatoFecha)));
                  //HORA
                  Date fechaFormatoHora = new Date( );
                  fichada.addContent(new Element("Hora").setText(formatoHora.format(fechaFormatoHora)));
                  //CAUSA
                  fichada.addContent(new Element("Causa").setText("0"));
                  doc.getRootElement().addContent(fichada);
                  XMLOutputter xmlOutput = new XMLOutputter();
                  xmlOutput.setFormat(Format.getPrettyFormat());
                  xmlOutput.output(doc, new FileWriter("C:\\fichadas.xml"));
                  contador=contador+1;
                  //fichadaHecha=true;

              }
                  } catch(IOException io){
                  }

          }
      }, 0L, 5000);

ここに私のconf.txtがあります

N_TERMINAL=18

ここで使うにはconf.txtのN_TERMINAL(18)の値を使いたい

fichada.addContent(new Element("N_Terminal").setText("HERE"));

誰かがこれを行う方法を知っていますか?

4

1 に答える 1