user567 Posted August 2, 2012 Report Posted August 2, 2012 Salut, offer 10 usd la primul dintre voi care imi scrieti codul php de mai jos in Delphi 7.<?php$imput = file("$argv[1]");$output = file("$argv[2]");if (!empty($imput) AND !empty($output)) {foreach ($imput as $nr => $line) {$ss = explode(":",$line);$email = trim($ss[0]);$pass = trim($ss[1]);$split = explode("@",$email);$utente = trim($split[0]);$domain = trim($split[1]);$SaveFile = fopen($output, "a");fwrite($SaveFile, "smpt.$domain:$email:$pass\r\n");fclose($SaveFile);}} else {Print "file.exe input.txt output.txt";}print "Done.\n";?> Quote
Paul4games Posted August 2, 2012 Report Posted August 2, 2012 (edited) Nu am nevoie de nici un ban, uite aici codul:program Extract;{$APPTYPE CONSOLE}uses SysUtils;var FileIn,FileOut: TextFile; S,Email,Password,Domain: String;beginif ParamCount >= 2 thenbeginif FileExists(ParamStr(1)) then begin AssignFile(FileIn, ParamStr(1)); Reset(FileIn); endelse WriteLn('The file' + ParamStr(1) + 'does not exist, please create it');if FileExists(ParamStr(2)) then begin AssignFile(FileOut, Paramstr(2)); ReWrite(FileOut); endelse begin FileCreate(ParamStr(2)); AssignFile(FileOut, Paramstr(2)); end;while not Eof(FileIn) do begin ReadLn(FileIn, S); Email := Copy(S, 1, Pos(':', S) - 1); Password := Copy(S, Pos(':', S) + 1, Length(S) - Pos(':', S)); Domain := Copy(Email, Pos('@', Email) + 1, Length(Email) - Pos('@', Email)); WriteLn(FileOut, 'smtp.' + Domain + ':' + Email + ':' + Password); end;CloseFile(FileIn);CloseFile(FileOut);WriteLn('Done');endelse Write('Example: file.exe input.txt output.txt');end.Ps: Cand rulezi executabilul nu uita sa folosesti comanda cd ca sa te duci in acel director altfel va spune ca fisierul input.txt nu exista.....se poate corecta usor bugul asta dar cred ca asta poti face si tu! Edited August 2, 2012 by Paul4games Quote
user567 Posted August 3, 2012 Author Report Posted August 3, 2012 Merci man, raman dator ... daca ai nevoie de ceva dami PM.Scriptul merge perfect, se vede ca sti bine php. Quote
Paul4games Posted August 3, 2012 Report Posted August 3, 2012 Merci man, raman dator ... daca ai nevoie de ceva dami PM.Scriptul merge perfect, se vede ca sti bine php.Din pacate nu stiu php, dar dupa ce inveti syntaxa unui limbaj iti este simplu sa intuiesti ce vrea sa faca un script ge genul! Quote