简体   繁体   English

使用C或Java的简单FTP程序

[英]Simple FTP program in C or Java

I need to write a program in C or Java to transfer the files from windows to Linux machine. 我需要用C或Java编写程序,以将文件从Windows传输到Linux机器。 requirement is to connect Linux machine, authenticate, option for select mode , transfer the file and disconnect. 要求是连接Linux机器,进行身份验证,选择模式选项,传输文件并断开连接。

But I am not getting a simple C or Java program for it,at least connect it and transfer a simple file. 但是我没有得到一个简单的C或Java程序,至少要连接它并传输一个简单的文件。 can you tell me please from where I can start? 你能告诉我从哪里开始吗? or any simple example programs are available, any clue any link. 或任何简单的示例程序可用,任何线索,任何链接。

Thanks in Advance 提前致谢

search for sample client/server applications in Java or C as you prefer.Than you can start adding your communication protocol. 根据需要搜索Java或C中的示例客户端/服务器应用程序。然后您就可以开始添加通信协议了。 You may be interested in asynchronous connections using select or other methods so the server will not hang waiting for client connections... 您可能对使用select或其他方法的异步连接感兴趣,因此服务器不会挂起以等待客户端连接...

First thing I would do is decide Java or C. 我要做的第一件事是决定使用Java还是C。

Deciding that, google for " FTP Libraries". 确定这一点,谷歌为“ FTP库”。 Read through their documentation and proceed to build your client. 通读他们的文档并继续建立您的客户。

Keep in mind that you must be connecting to a machine that is accepting FTP connections (or perhaps you have to write the FTP server side as well? Get verification of this from whoever is giving you the assignment.) 请记住,您必须连接到接受FTP连接的计算机(或者也许您还必须编写FTP服务器端?从向您分配任务的任何人那里进行验证)。

You might want to have a look at the libcurl library . 您可能想看看libcurl库 There is, in the examples section, an ftp client program that might suit you. 在示例部分中,有一个适合您的ftp客户端程序

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM