在C#中构建LAN应用程序 [英] Build a LAN Application in C#

查看:59
本文介绍了在C#中构建LAN应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在问这个问题之前,我想告诉你,我已经在谷歌搜索了2周但对我的疑问不满意。

我已经用c#完成了一个应用程序(对于单个用户)

现在,我想在不同的计算机上运行它,不同的用户登录访问一个数据库。

我的查询是。



Before asking this question i wanna told you that i have been googling since 2 week but not satisfied with my queries.
I have completed an application in c# (for Single user)
now, i want to run it on different computers with different users login accessing a single DB.
my Queries are.

How Can It Possible..?




Is HUB, Router,Switch Needed..?




Is there need to add some extra code in you application..?




What about the permission to SQL Server 2012 to access database remotely..?




What about the Connection String in your code..?




How can i Set up this network..?





提前感谢。 :)



Thank in Advance. :)

推荐答案

在实践中,是的,你需要一个集线器,路由器或交换机 - 它充当现代网络的核心并允许更高的速度(比旧的单线到每个人多点同轴设计更多,更高的速度。现代ADSL或有线调制解调器通常提供4个左右的有线和多个无线端口,以及充当DHCP控制器来分配IP地址。



如果你正在使用局域网,然后SQL Server通常会自动配置为在安装时正常工作 - 当你想从互联网访问数据库时,你真的只需要担心远程访问 - 这是一个非常糟糕的主意。安全POV。



在一台PC上安装SQL Server,从另一台计算机上找到连接字符串,并将其放入配置文件中(如果你需要将SQL移动到您不需要的其他PC上;需要重新编译您的程序)并从您的APP中访问该值。



是的,您需要在您的应用程序中添加代码 - 但它不是太复杂,具体取决于您想要对数据库执行什么操作 - 它可能很简单,或者可能非常复杂,但这取决于应用程序而且它是重要的quirements。有大量的书籍,网络教程等可以告诉你该怎么做。
In practice, yes, you will need a hub, router or switch - this acts as the "core" of a modern network and allows higher speeds (much, much higher speeds) than under the older "one-wire-to-everybody" multi drop coaxial design. Modern ADSL or Cable modems generally provide 4 or so wired and a number of wireless ports, as well as acting as the DHCP controller to assign the IP addresses.

If you are working on a LAN, then SQL Server will normally be automatically configured to work fine when it is installed - you really only need to worry about remote access when you want to access the DB from the internet - which is a seriously bad idea from a security POV.

Install SQL Server on one PC, work out the connection string to it from a different one, and put that in a config file (so that if you need to move SQL to a different PC you don;t need to recompile your program) and access the value from there in your APP.

Yes, you will need to add code in your application - but it's not too complex, depending on exactly what you want to do with the DB - it can be simple, or it can be horribly complicated, but that is down to the application and it's requirements. There are a huge range of books, web tutorials, and so forth that can show you what to do there.


这篇关于在C#中构建LAN应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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