我想看看基本的網絡服務的源代碼一樣 FTP,遠程登錄,遠程登錄等FTP源代碼
誰能告訴我在哪裏可以得到它們。順便說一下,它並不是我沒有谷歌它,例如搜索ftp,給了我很多ftp變體的列表,但是我在看着一個隨Ubuntu發佈的ftp客戶端/服務器。
感謝
我想看看基本的網絡服務的源代碼一樣 FTP,遠程登錄,遠程登錄等FTP源代碼
誰能告訴我在哪裏可以得到它們。順便說一下,它並不是我沒有谷歌它,例如搜索ftp,給了我很多ftp變體的列表,但是我在看着一個隨Ubuntu發佈的ftp客戶端/服務器。
感謝
http://archive.ubuntu.com/ubuntu/pool/main/n/netkit-ftp/netkit-ftp_0.17.orig.tar.gz
如果它是專門Ubuntu的源代碼,您有興趣,這很容易。轉到包描述頁面,如http://packages.ubuntu.com/lucid/net/,請遵循相關鏈接,並在包描述中查找指向.orig.tar.gz文件的鏈接。 Ubuntu軟件包都可以這樣工作。
的源代碼鏈接是在包裝頁面的頂部上http://packages.ubuntu.com/
這裏的代碼
<?php
$ftp_server = 「www.yoursite.com」;
$ftp_user_name = 「username」;
$ftp_user_pass = 「password」;
$conn_id = ftp_connect($ftp_server);
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
if ((!$conn_id) || (!$login_result)) {
echo 「FTP connection has failed!」;
echo 「Attempted to connect to $ftp_server for user $ftp_user_name」;
exit;
} else {
echo 「Connected to $ftp_server, for user $ftp_user_name」;
}
$dir = 「」;
function filecollect($dir,$filelist) {
global $conn_id; //Get our ftp
$files = ftp_nlist($conn_id,$dir); //get files in directory
foreach ($files as $file) {
//$isfile = ftp_size($conn_id, $file);
if($isfile == 「-1″) { //Is a file or directory?
$filelist = filecollect($dir.’/’.$file,$filelist,$num); //If a folder, do a filecollect on it
}
else {
$filelist[(count($filelist)+1)] = $file; //If not, add it as a file to the file list
}
}
return $filelist;
}
$filelist = filecollect($dir,$filelist);
echo 「<pre>」;
print_r($filelist);
echo 「</pre>」;
$dir=」yoursite.com」;
$filelist = filecollect($dir,$filelist);
echo 「<pre>」;
print_r($filelist);
echo 「</pre>」;
$new=explode(「/」,$filelist['73']);
$myFile =$new[1];
//echo 「$myFile」;
$fh = fopen($myFile, ‘r’) or die(「can’t open file」);
//$fh = fopen($myFile, ‘w’) or die(「can’t open file」);
//$stringData = 「Ashwani\n」;
//fwrite($fh, $stringData);
$the = fread($fh, 1000000);
fclose($fh);
?>
<form action=」" method=」post」 enctype=」multipart/form-data」 name=」form」><table width=」100%」 border=」0″>
<tr>
<td><? echo $new[1]; ?></td>
<td><textarea name=」textarea」 cols=」40″ rows=」40″><? echo $the; ?></textarea></td>
</tr>
</table>
</form>
這不是ftp的代碼。這是如何使用ftp實現的 – mjs 2015-05-06 08:13:40
我提到Ubuntu的只是作爲一個例子,基本上我想知道什麼,在大多數Linux發行版默認運行FTP規則。 – Anonymous 2010-10-16 05:33:08
@匿名我看。那麼,所有的Linux發行版都非常依賴相同的代碼庫,不同之處在於包的其他重要組件的補丁以及缺省配置文件中。因此,您仍然可以使用任何組織良好的發行版的Web目錄來獲取大部分內容。 – 2010-10-16 05:39:41