如何通过C#编程自动将客户端与局域网中的服务器连接起来。 [英] How to connect client automatically with the server in LAN from C# programming.

查看:410
本文介绍了如何通过C#编程自动将客户端与局域网中的服务器连接起来。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我打算写一个包含服务器和其他客户端的聊天应用程序。首先,服务器在计算机中启动,当我们在其他计算机上启动客户端时,它应该自动连接到最初启动的服务器。

I am going to write a chat application that includes a server and others client. At first server be started in a computer and when we started client in other computers it should automatically connect with the server that is started at first.

推荐答案

1)添加客户端自动启动应用程序(注册表,登录脚本,启动文件夹等)。

2)尝试连接应用程序启动,如果失败,请等待预定义的时间再试一次

3)如果连接成功,继续使用应用程序
1) Add client to autostart applications (registry, logon script, startup folder, etc..)
2) Try to connect on application start, if fails, wait a predefined amount of time and try again
3) If connection succeeds, continue with the application


这篇关于如何通过C#编程自动将客户端与局域网中的服务器连接起来。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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