.NET中的客户端服务器编程 [英] Client Server programming in .net

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

问题描述

HI 当前我正在开发一个由服务器部分和其他工作站两部分组成的软件.服务器和工作站可以在两台不同的计算机上运行.现在如何在这两个应用程序之间建立连接以便它们可以传输数据.
我想到的是运行在Server机器中的窗口服务,该服务将存储来自数据库的数据,但无法理解如何将这些数据传输到客户端.一个人认为无法使用(IIS,自托管的wcf,sqlserver身份验证).是使用Socket ..进行客户端/服务器编程的.但是对此领域没有任何想法.欢迎提出任何想法

感谢进阶

Devopriyo Seal

HI Currently I am developing a software which will have two part one server part and other Workstation .The Server and Workstation can run in two different machine.Now how can make connection between this two application so that they can transfer data.
I ma think of window service running in Server machine which will store data from database but not able to understand how to transfer this data to client part.one think cannot use (IIS , self hosted wcf,sqlserver authentication).I guess it have to be Client/server programming with Socket ..But have no idea in this field.Any idea is welcome

Thanks In advanced

Devopriyo Seal

推荐答案

好吧,使用套接字是正确的.
但是您能更具体一点吗?我建议您看一下Socket类及其方法.

http://msdn.microsoft.com/en-us/library/system. net.sockets.socket.aspx [ ^ ]

您打算使用哪种协议? UDP? TCP?

如果使用udp,则有两个连接选项:同步和异步.要了解更多信息,请看以下内容:
http://msdn.microsoft.com/en-us/library/ms734701.aspx [ ^ ]

我在这里使用异步通信编写了一个教程:
http://codeabout.wordpress.com/2012/02/20/building-a-simple-chat-application-using-asynchronous-communication-and-udp-in-c/ [ http://codeabout.wordpress.com/2011 /03/06/building-a-simple-server-client-application-using-c/ [
Well, you are right about using Sockets.
But can you be more specific? I recommend you to take a look at Socket Class and its methods.

http://msdn.microsoft.com/en-us/library/system.net.sockets.socket.aspx[^]

Which protocol are you planning to use? UDP? TCP?

If you use udp you have two options of connection, synchronous and asynchronous. To know more about it, look at this:
http://msdn.microsoft.com/en-us/library/ms734701.aspx[^]

I have written a tutorial using asynchronous communication here:
http://codeabout.wordpress.com/2012/02/20/building-a-simple-chat-application-using-asynchronous-communication-and-udp-in-c/[^]

On the other hand, if you want a TCP protocol, I may have done something in the past as well... I''m not sure if it fits to you, look:
http://codeabout.wordpress.com/2011/03/06/building-a-simple-server-client-application-using-c/[^]

As I said, if you could be more specific about your application, I''m glad to help! :)


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

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