开发者

C# windows form app that can be accessed within the network

开发者 https://www.devze.com 2023-04-05 06:46 出处:网络
I\'m a C# noob and i want to ask if it\'s possible for this kind of scenario: I have a windows form app in C#, is it possible i will only install it in 1 computer(as a server) and it can be accessibl

I'm a C# noob and i want to ask if it's possible for this kind of scenario:

I have a windows form app in C#, is it possible i will only install it in 1 computer(as a server) and it can be accessible from all the computers within the network? If it's possible can you please help me what i need to do, any reference/books/tutorials?

I already goo开发者_C百科gled this but i think i can't find the correct 'search word' that's why i didn't get the desired search result.


Yes it is possible. Put the C# executable in a network UNC Path, and you can access it if you create a link on the destination desktops. XP SP 2 and higher by default can run it. If it has .NET 3.0 or 3.5 or 4.0 framework you may need to install the Runtimes for those frameworks, but .NET 2.0 should be fine with XPsp2. All the frameworks are downloadable from Microsoft's site.

Is this a database driven app or just a straight up stand alone?

You don't need any books, it should work just fine. But provide as many details as you can so we can steer you in the right direction.


You may have to do a large code overhaul to do this. Could you simply install it on one computer and remote login to that computer and access it?

You see the thing about network-accessed programs is that they have two parts--a client and a server. It sounds like you just have one piece. You would need to write a program that is a windows form and install it on all the machines. You would then need to write your server code that receives the data from the client over the network.

You would need to know about socket programming. Here is a book introductory tutorial of C# and sockets. http://www.codeproject.com/KB/IP/socketsincsharp.aspx


I'm not 100% sure what you're asking, but hopefully this covers it. If not, please edit your question to be more specific.

You can generally run a WinForms application from a shared network drive/folder by copying the executable to that drive (and making sure that all users have appropriate access to that network location).

If you use an automatic installer, it should be possible to select a network share as the place to install the software. Automatic installers tend to also put things in the local registry (e.g. create menu items for the program, which go on the local computer always). In that scenario, you would want to create an installer that creates appropriate shortcuts/menu items on the local computer that point to the pre-installed executable on the network share.

You need to take care that the windows forms application doesn't write data to the network share, or if it does, that it does so in a manner consistent with multiple users accessing that data (in other words, keep in mind that all of your users will share that location).


Put it in a shared folder and access either by UNC path or map a drive to that location. You could also map the drive for all users with group policy.

Alternatively you could wrap your app into an MSI and install it via group policy?

Hope this helps :)


You should use a layered approach to your software design. Create a website to give users access to the application from multiple locations. Then create a service layer to give the website access to the desktop functionality that you require. WCF is a good service layer as it allows consumption through HTTP.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号