[ feniks-sd @ 24.01.2009. 21:04 ] @
Imam kod napisan u QT, koji služi za spajanje na FTP server. Sa ovim kodom mogu se spojiti kao anonnimus. Nikako da dodam password i username.

Code:
 

 QUrl url(ftpServerLineEdit->text());

     if (!url.isValid() || url.scheme().toLower() != QLatin1String("ftp")) {
         ftp->connectToHost(ftpServerLineEdit->text(), 21);
         ftp->login();
     } else {
         ftp->connectToHost(url.host(), url.port(21));

         if (!url.userName().isEmpty())
             ftp->login(QUrl::fromPercentEncoding(url.userName().toLatin1()), url.password());
         else
             ftp->login();
         if (!url.path().isEmpty())
             ftp->cd(url.path());
     }