ارسال الملفات عن طريق FTP
#2
السلام عليكم ورحمة الله

هذا جزء من برنامج يقوم تقريبا بنفس الفكرة

كود :
procedure TfrMain.CreateOrOpenDirectoryOnFTPServer; var   I: Integer;   myYear: string;   myMonth: string;   myDate: string;   IsDirectoryExists: Boolean; begin   IsDirectoryExists := False;   if IdFTP1.Connected then   begin     Memo1.Lines.Add('Connected to ' + IdFTP1.Host);     Memo1.Lines.Add('Start check if the remote folders exists');     myYear := IntToStr(YearOf(Date));     myMonth := FormatSettings.LongMonthNames[MonthOf(Date)];     myDate := FormatDateTime('YYYYMMDD', Date);     IdFTP1.List;     for I := 0 to IdFTP1.DirectoryListing.Count - 1 do     begin       if IdFTP1.DirectoryListing.Items[I].FileName = myYear then       begin         IsDirectoryExists := True;         Break;       end;     end;     if not IsDirectoryExists then     begin       IdFTP1.MakeDir(myYear);     end;     IsDirectoryExists := False;     IdFTP1.ChangeDir(myYear);     IdFTP1.List;     for I := 0 to IdFTP1.DirectoryListing.Count - 1 do     begin       if IdFTP1.DirectoryListing.Items[I].FileName = myMonth then       begin         IsDirectoryExists := True;         Break;       end;     end;     if not IsDirectoryExists then     begin       IdFTP1.MakeDir(myMonth);     end;     IsDirectoryExists := False;     IdFTP1.ChangeDir(myMonth);     IdFTP1.List;     for I := 0 to IdFTP1.DirectoryListing.Count - 1 do     begin       if IdFTP1.DirectoryListing.Items[I].FileName = myDate then       begin         IsDirectoryExists := True;         Break;       end;     end;     if not IsDirectoryExists then     begin       IdFTP1.MakeDir(myDate);     end;     IdFTP1.ChangeDir(myDate);   end; end;

ملحوظة البرنامج كله مفتوح المصدر اذا اردت الاطلاع عليه اخبرنى
[-] كل من 1 user says قال شكرا ل justnick على المشاركة المفيدة
  • Intermediate Delphi programmer
الرد


الردود في هذا الموضوع
ارسال الملفات عن طريق FTP - بواسطة bibill - 18-12-2023, 09:57 AM
RE: ارسال الملفات عن طريق FTP - بواسطة justnick - 18-12-2023, 08:10 PM
RE: ارسال الملفات عن طريق FTP - بواسطة bibill - 19-12-2023, 09:04 AM
RE: ارسال الملفات عن طريق FTP - بواسطة bibill - 19-12-2023, 11:41 AM
RE: ارسال الملفات عن طريق FTP - بواسطة justnick - 19-12-2023, 04:40 PM
RE: ارسال الملفات عن طريق FTP - بواسطة justnick - 29-01-2024, 05:43 PM

التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم