DateTimePicker ????



  • Hi ich habe mich vorkurzen mit dieser Frage gestellt:

    hi ich will Dateien mit einen Bestimmten Datum kopieren wie mach ich das?????

    ich bin zu faul jedes mal die Dateien zu suchen und dann zu kopieren deswegen will ich ein Programm schreiben dafür das es automatisch macht.

    Vielen Dank im voraus

    Werner2005

    Wer sich das ankucken will http://www.c-plusplus.net/forum/viewtopic-var-p-is-854395.html#854395

    Ich habe jetzt herausgefunden wie ich Dateien Suche und Kopiere ich habe jetzt das Problem ich will mit Hilfe eines DateTimePicker das Start wie auch das End Darum eingeben das Problem ist wenn ich jetzt aus TSearchRec die Zeit auslese kommt da eine Zahl raus z.B. Heute 857042678 was bedeutet das?? und was sagt mir die Zahl aus dem DateTimePicker da kommt auch eine Zahl raus was bedetet die z.B. Heute: 38585.

    Vielen Dank

    Werner2005

    Mein Bisheriger Qelcod sie wie folgt aus:

    void __fastcall TForm1::Button1Click(TObject *Sender)
    {
      TSearchRec sr;
      int iAttributes = 0;
      StringGrid1->RowCount = 1;
      iAttributes |= faReadOnly * CheckBox1->Checked;
      iAttributes |= faHidden * CheckBox2->Checked;
      iAttributes |= faSysFile * CheckBox3->Checked;
      iAttributes |= faVolumeID * CheckBox4->Checked;
      iAttributes |= faDirectory * CheckBox5->Checked;
      iAttributes |= faArchive * CheckBox6->Checked;
      iAttributes |= faAnyFile * CheckBox7->Checked;
      StringGrid1->RowCount = 0;
      if (FindFirst(Edit1->Text, iAttributes, sr) == 0)
    
      {
    
        do
        {
          if ((sr.Attr & iAttributes) == sr.Attr)
          {
    
            StringGrid1->RowCount = StringGrid1->RowCount + 1;
            StringGrid1->Cells[1][StringGrid1->RowCount-1] = sr.Name;
            StringGrid1->Cells[2][StringGrid1->RowCount-1] = IntToStr(sr.Size);
            StringGrid1->Cells[3][StringGrid1->RowCount-1] = sr.Time;
    
          }
        } while (FindNext(sr) == 0);
        FindClose(sr);
      }
    }
    


  • Hallo

    bitte die BCB-Hilfe lesen

    Time enthält den Zeitstempel der Datei. Dabei handelt es sich um einen DOS Datums/Uhrzeitstelmpel. Mit FileDateToDateTime kann dieser Wert in einen TDateTime-Wert konvertiert werden.

    /Edit : du brauchst auch keinen TDateTimePicker, um die Daten zu vergleichen.
    Das kannst du über die normalen Operatoren machen.

    bis bald
    akari



  • Hi jetz habe ich es direkt verglichen

    Aber es funzonirt nicht er sagt alles were in dem von Mir angeben Zeitraum erstellt worden

    mein Qulecod was ist fasch?????

    void __fastcall TForm1::Button1Click(TObject *Sender)
    {
      TSearchRec sr;
      int iAttributes = 0;
      StringGrid1->RowCount = 1;
      iAttributes |= faReadOnly * CheckBox1->Checked;
      iAttributes |= faHidden * CheckBox2->Checked;
      iAttributes |= faSysFile * CheckBox3->Checked;
      iAttributes |= faVolumeID * CheckBox4->Checked;
      iAttributes |= faDirectory * CheckBox5->Checked;
      iAttributes |= faArchive * CheckBox6->Checked;
      iAttributes |= faAnyFile * CheckBox7->Checked;
      StringGrid1->RowCount = 0;
      if (FindFirst(Edit1->Text, iAttributes, sr) == 0)
    
      {
    
        do
        {
          if ((sr.Attr & iAttributes) == sr.Attr)
          {
    
            StringGrid1->RowCount = StringGrid1->RowCount + 1;
            StringGrid1->Cells[1][StringGrid1->RowCount-1] = sr.Name;
            StringGrid1->Cells[2][StringGrid1->RowCount-1] = IntToStr(sr.Size);
            StringGrid1->Cells[3][StringGrid1->RowCount-1] = sr.Time;
           if(sr.Time >= DateTimePicker1->DateTime || sr.Time <= DateTimePicker2->DateTime)
              {
               StringGrid1->Cells[3][StringGrid1->RowCount-1] = "richtig";
             }
             else
             {
              StringGrid1->Cells[3][StringGrid1->RowCount-1] = "falsch" ;
             }
    
          }
        } while (FindNext(sr) == 0);
        FindClose(sr);
      }
    }
    


  • Hallo

    ich hab ja bereits geschrieben das du sr.Time erstmal mit FileDateToDateTime konvertieren must.

    bis bald
    akari



  • Wie geht das mit FileDateToDateTime ????



  • Hallo

    also du solltest dir angewöhnen, mal die BCB-Hilfe zu genannten Stichworten zu durchsuchen

    TDateTime FileDate = FileDateToDateTime(sr.Time);
    

    bis bald
    akari


Anmelden zum Antworten