简单的客户端/服务器应用程序 [英] simple client/server application

查看:86
本文介绍了简单的客户端/服务器应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好.
我想使用Windows窗体应用程序在C#中开发一个简单的客户端/服务器应用程序.

例如,当单击客户端中的按钮时,它将获得计算机的IP地址,并将该IP地址传递给服务器.服务器会在另一个窗口中显示它.

我该怎么做?

谢谢.

Hello.
I want to develop a simple client/server application in C#, using Windows Form Application.

For example, when the button in client is clicked, it will get the IP address of the machine, and pass the IP address to the server. The server will display it, of course in another window.

How would I be able to do that?

Thanks.

推荐答案

您可以通过简单的套接字连接来实现.你可以看到它.

C#中的套接字 [ http://www.c-sharpcorner.com/uploadfile/dottys/socketprogdtrp112220050050230am/socketprogdtrp.aspx [ ^ ]

http://www.csharp-examples.net/socket-send-receiv [ ^ ]
You can do it by simple socket connection. you can see it.

Sockets in C#[^]

http://www.c-sharpcorner.com/uploadfile/dottys/socketprogdtrp11222005023030am/socketprogdtrp.aspx[^]

http://www.csharp-examples.net/socket-send-receiv[^]


您还可以看到此链接以获取您的计算机的IP地址.

http://www.csharp-examples.net/local-ip/ [ http://netomatix.com/MachineIp.aspx [
You also can see this link for get the IP address of your machine.

http://www.csharp-examples.net/local-ip/[^]
http://netomatix.com/MachineIp.aspx[^]


这篇关于简单的客户端/服务器应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆