问题
In this asp.net web application, users can upload files to the server through a web interface. All the uploaded files are save in a server side folder. If I want to create a new win form desktop client (actually, its a WPF application) which can be used to upload files to that same server side folder as web interface does, how can I share that server side folder with that win form client? Any alternative suggestions are also welcome.
thanks for all in advance.
回答1:
Like answered in What is the best way to store files in a (asp.net + wcf) web application:
- Use the WCF tier as a common ground and store the images behind that service. As I said it's going to be an extra to pull the byte arrays over.
- Store the images in the Web UI tier and have a service (asmx or WCF one) to expose the images to your winforms/WPF client.
- Make a share for the winforms/WPF client on the server where the web ui runs, and where the images are. Of course be sure to be respectful to security and possible hacks.
回答2:
Several ways; you could consider creating a web service on that same server, and the wpf app will communicate with this service. Or, if in the same network, it should be able to communicate via a network share, provided the proper permissions are set.
HTH.
来源:https://stackoverflow.com/questions/3362341/how-to-share-a-folder-in-a-asp-net-web-application-with-a-win-form-client