开发者

C# client app vs. web app

开发者 https://www.devze.com 2022-12-21 04:16 出处:网络
I mainly develop C# web type applications but recently someone in our engineering group wants to re-create this rather simple C# client based app to a C# web based app.Well I found out that all the ap

I mainly develop C# web type applications but recently someone in our engineering group wants to re-create this rather simple C# client based app to a C# web based app. Well I found out that all the application does is create a network folder structure (a parent directory with some sub directories within it).

I then mentioned what are the benefits to making this a web app being that all it does is create some network folder structure. Well he mentioned that he does not want to create a client application and have say 50 users install this client application. He wanted it to be in one central place. So I thought can't you just create one C# app and throw it on the network and have multiple people open it and use it?

Is that possible? I am not a client developer so I would think logically this is possible, but then I thought that if it was a network app then one user opening this application would lock other users out? I pe开发者_运维知识库rsonally don't like the idea of webifying this application (making it web based) as to me it really doesn't make sense to be a web app.

Thoughts / Ideas ?

More Info (EDIT)

Well I guess I should of included more information. The folders are created via some database data. So it cannot be a batch file or a script. The end user has to select some entry from a drop down list and that value becomes the value of the parent folder name.


Did you consider using ClickOnce to deploy your current app as an alternative for creating web based apps? This would ease the installation a lot.

The other option is just place this app on the network share and let the user run from the share.


What do you do when you find a bug?

What do you do when you have new features?

With a web application you do not need to redeploy to all your (known) clients, but keep deployment to one central location.


For this sort of thing, it might actually be better to write a simple Powershell script which can do the job.


I would recommend using the web app. Other than the benefits by oded. Here are some.

Deploying the software for 50 users will not be a difficult for an IT support but releasing a new web app to 50 users will be much easier. Also if they are upgrading the OS for the 50 uers then your app has to be tested thoroughly before deploying. This is another extra wprk that your IT support has to do.

When there is an upgrade to your client app then it has to be rolled out again to all users. Also the upgrade should check for any personalization and then preserver it and its too much extra work. In a web app you can upgrade at the server.

Also with .net capabilities you can manage security very easily.


I've had some experience with issues running .Net apps from a network Share, although I'm sure there are solutions. (I just never needed to bother with finding those solutions.) Mostly, they were permissions issues, and it seemed to me that I would need to edit the security policy to get it to work, and that seemed like a hack, so I just learned to evaluate the requirements better and avoid this.

However, when I read the question, I wonder if .net is the right tool for the job anyway? This seems to me to be more of an issue that could be handled more easily in a script of batch file.

I hate writing scripts and batch files because it's just not as much fun, and I would rather use .Net for just about everything, but there is such a thing as the right tool for the job. (I try to avoid having .net become my hammer, because not all problems are nails.)

Added based on additional info

Ah.. That makes a difference. Then a Script would still be feasible, but if it were me I'd do a client app just because it's easier BUT I'd get around the not wanting to install this to multiple clients like this.

Hack warning - This works, but I'll probably get beat up for suggesting such a hack.

Since .Net client apps don't generally require installation programs, and can by copied via xcopy deployment, I've done this in exactly your situation:

  • Write the app as a console applicaiton
  • Put all files necessary to run on a Network share in a folder.
  • Write a batch file that
    • creates a folder on the client's PC (overwriting any existing contents)
    • copies the contents of the folder on the server to the client's PC
    • runs the executable.

This makes installation and updates a non-issue in the simplest way possible. Eaiser than ClickOnce (which is good, but would be overkill for such an app)

Example of the batch file:

C:\
cd \
md MyApp
copy \\SomeServer\SomeShare\*.* myapp
cd myapp
call myApp.exe


Yes - your friend is a nutter...

Rather than just drop this on a network, as you have suggested, he wants to have to install a webserver on his machine, then install your app on the webserver, and then call it locally?

Keep your friend away from the C# compiler - or any other come to that... They're not for the likes of him...


Would you be using WinForms or WPF? I think if you do WPF, you just make your app a WPF Browser Application, which I think is like a hybrid of the two.


In my opinion if all it does is creating Dir structures you could use AutoIt v3. Using AutoIt v3 you can compile .exe with no external libraries / installation needed.

Usage of the script is as simple as using DirCreate or similar to do what you want. I guess if it's just simple script it could be 10 liner even.

Creates a directory/folder.
DirCreate ( "path" )

Parameters: path Path of the directory to create.

Return Value Success: Returns 1.
Failure: Returns 0 if there is an error creating the directory. Remarks

This function will also create all parent directories given in "path" if they do not already exist.

Using C# for just this is overkill. You create this script, compile it to .exe put on a network share and users will just start it themselfs (or make it thru login script or gpo). Multiple people can start the script from share without affecting anything.

Of course you could use C# as well and it will work for multiple people to start it but much simpler, cleaner way is to do it thru scripting in AutoIt v3, or even VBS if you trust it more.

Edit:
Just saw your edit that it involves DB. AutoIt is capable of using DB (depends which too) but i guess it's a bit harder then DirCreate :-) Anyways I'm PRO WinForms, Console app in C# then a WEB APP.

Multiple people can start it at once from a share and there's no problem with that.

0

精彩评论

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