且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何将文本数据从一台计算机传输到另一台计算机

更新时间:2022-12-23 21:49:08

就像理查德在对你的问题的评论中提到的那样,您可以使用套接字建立网络连接并将文件发送到该计算机。加密邮件后,请ping设备并请求设备发送数据。建立连接后,开始发送数据。然后,在另一边,接收数据并在那里解密。



首先,它比听起来更简单,唯一的补充是 TcpListener TcpClient 两个应用程序都可以通过网络进行通信的对象。



我写了一篇文章,涵盖了你可能想知道的所有内容,然后继续创建这样的应用程序,可以在网络上进行通信,在这里查看一下,使用本机.NET TCP库创建服务器/客户端应用程序 [ ^ 一>]。然后你可以将数据从一台机器发送到另一台机器。
Just the way Richard mentions in his comment to your question, you can use sockets to establish a network connection and send the file over to that machine. Once you have encrypted the message, ping the device and request it to allow your device to send the data. Once the connection has been established, start sending the data. Then, on the other side, receive the data and decrypt it there.

Primarily, it is simpler than it sounds, the only addition is of TcpListener and TcpClient objects that would both applications to communicate over the network.

I wrote just the article that covers everything you may want to know before proceeding with creation of such applications, that can communicate on the network, have a look at it here, Creating a server/client application using native .NET TCP library[^]. Then you can send the data from one machine to another.


你需要多长时间才能完成这个项目?首先获取基本功能。加密到文件,手动将其复制到另一台计算机,然后解密。当你完成这项任务时,你会尝试扩展它。当你打开它时,让核心功能工作比让它不起作用更好,因为你花了所有的时间来尝试让其他工作与项目没有任何关系,你想要的功能是需要花费大量的时间和资源才能开始工作。
How long do you have to work on this project? Get the base functionality down first. Encrypt to a file, manually copy it over to the other machine, and decrypt it. When you get this done ONLY THEN do you try to expand on it. It's better to have the core functionality working when you turn it in than to have it not working because you spent all of your time trying to get something else working that doesn't have anything to do with the project, and the functionality you want is going to take a lot of time and resources to get working.