Folder explorer options - c#

I have recently been assigned a task which sounded relatively simple!
Upon attempting it became clear it wasn't as straight forward as i first imagined!!!
I am trying to download multiple files to one location on the users machine. They select these files from lists within a custom share-point web part. Thats the bit i have managed to get working! The downloading is done via WebClient (System.Net.WebClient)
I now want to allow the user to select a location on their local machine to download the files to.
I thought i would be able to use but after attempting this i realized i can only pick files :( in order to get the desired location which will confuse the user
I want something similar to the above but i only need it to return a path location like c:\Temp or any other location the user prefers on their local machine.
Could anyone suggest a control that could provide this functionality. It can also be a share-point control.
In the meantime I will be attempting Tree view as i have never used these before and these may have the power to do this from what i have read
Cheers
Truez
Clarity on language ASP.NET

Unfortunately, you can't do this without some kind of active content, like a Flash control or spit activeX /spit.
It seems strange at first, but you have to consider that this kind of functionality would let a site discover the structure of anyones storage devices; this is not 'a good thing'™
However, perhaps a different approach might solve the problem?
Why are you using WebClient, can't you provide the link to the client and let them choose their own download folder ?

I ended up zipping the files in to one folder and passed the file to be downloaded through the browser! Thanks for your comments!

Related

Is it possible for a user to only select file save location once?

I've been trying to learn how to handle saving normal .txt files in UWP, and have realized that it's quite locked down compared to WPF, especially in the sense of what folders you can access without requesting the user to select a location. I have searched for various ways this might be possible but found no working answer.
Question Description:
I basically would love to know if this is possible, and preferably a point in the direction where I can learn how exactly to do this.
Application settings page requires user to select folder where files are saved.
Application remembers this between launches (unsure if this is possible, but I can't require the user to select the folder on every launch)
Application saves files to the specified folder.
In my understanding, this should be possible, as the user is the one specifying the location via filepicker, but is it possible to have this work between launches so that the user wont be required to re-select the save folder?
I need to figure this out, as I would like my application to support selecting attached network drives, cloud storage folders, etc.
Any help is very much appreciated, and if there are any questions I will answer them to the best of my ability.
Fow this purpose there are two access lists designed: FutureAccessList and MostRecentlyUsedList. Once the user has picked up the folder with the picker, you add it to such list and receive a token, which you save for future purpose in LocalSettings:
ApplicationData.Current.LocalSettings.Values["MyFolder"] = StorageApplicationPermissions.FutureAccessList.Add(pickedFolder);
Then later, once you want to access that folder, you can do it like this:
StorageFolder folder = await StorageApplicationPermissions.FutureAccessList.GetFolderAsync(ApplicationData.Current.LocalSettings.Values["MyFolder"].ToString());
You can't save a StorageFolder or a path to it in settings, hence the UWP app needs permissions to access the folder. Using above access lists solves this problem.
I believe you want to save user settings and keep it somewhere so that next time when they launch the application, they can use the same settings.
Please check out this tutorial from Microsoft, which describes how to do exactly that.
https://msdn.microsoft.com/en-us/library/bb397750(v=vs.110).aspx

ASP.net Create a Torrent from File

Our current software updates are hosted on our server.
We'd like to offer Torrents as an alternative download option from our server. When new releases are published it should offer people better download speeds if people seed it.
I've figured out everything except how to create a Torrent file automatically (we'd rather not have to create it manually each time).
Does anyone know how we can create a torrent file from a specified exe file?
Thanks!
MonoTorrent seems like it might be of help. I've previously compiled and run it under .net, so no worries there.
This looks like the relevant wiki page.
As usual, it's probably best to check license compatibility before integrating with your product, but it looks quite permissive.
Of course, you'll need to host the torrent to ensure at least a single seed!

Displaying a large collection of large images

OK, I thought this was a fairly simple task, but apparently it isn't ...
I have a folder with +1000 photos in it. These are all photos taken with a camera, each about 3 MB. Users need to be able to view these pictures (as a list), rename or delete them. That's it.
A possible solution would be this control : ImageListView - CodeProject
but because it has an Apache license, we can't use it.
So how to do it? Any ideas or suggestions? I'm using .NET 2.0
.... EDIT : .....................................
OK, apparently we CAN use the Apache license. (Also see: https://stackoverflow.com/questions/1007338/can-i-use-a-library-under-the-apache-software-license-2-0-in-a-commercial-applic) However, using the license is very confusing for me. I read the following guide but still don't exactly know how to apply it to our project : http://blog.maestropublishing.com/how-to-apply-the-apache-20-license-to-your-pr
it says:
you need two files in the root or top directory of your distribution.
What's exactly meant by 'distribution'? Is that our installed application, and top directory meaning Program files/OurApp/ ?
It also says:
Replace all [bracketed] items in the above notice statement. There are only two of these items so should not be hard for you to do.
But that would give me a notice file, reading :
Copyright 2012 OUR_COMPANY
Licensed under the Apache License, etc...
But our app isn't licensed under the Apache license?
I'm sorry but I'm very confused and don't want to make any mistakes with this legal stuff...
What would I need to do exactly to be able to use this control?
Perhaps you need your own control for this task.
What i think is just a sketch of what i`d do in your place.
You need your own control with paging(to show only limited photos to user) or scroll-event-driven(to load photos on demand).
Perhaps you need some thumbnail generator.
Point is you probably face a huge pile of photos, so you cannot get them all in one time.
"Thats it" is not that simple.
For 1000+ that is over 3 GB.
Would need thumbnails for faster preview.
If users are going to access this files directly then they would need NTFS permission.
Maybe what you want.
What you are going to get into in locking problems.
If one user has a file open then you cannot rename or delete it.
I know you are not going to like this but to do it right you need a server app to manage that folder and users access via a WCF service so there is a single control point.

Create a Directory using Directory.CreateDirectory( ) that gives a warning message when trying to delete or rename

My application creates several text files that contain important data for its working. I am grouping up all these files in a folder. In Form_load() I gave Directory.CreateDirectory("C:\\xyz"), so that a folder is created in a drive which will later include text files, when the application will be delivered to clients. I want to see that the user does not delete or rename the folder. A dialog box that shows some warning message will be helpful. Is it possible with Directory.CreateDirectory()?
I think you should just warn the user about the importance of this directory. However, you can recreate the directory by performing this kind of check :
if(!Directory.Exists(path))
Directory.CreateDirectory(path);
From this point, you can imagine a mecanism that save the important files in a temporary way, and if the directory is deleted, you recreate it and put the previously saved files in it.
First of all, you might find reading this helpful.
Second: If I understand your needs correctly, what you want is much more painful than you think.
You should really consider doing what Damien_The_Unbeliever told you.
However, if you insist: You will need to use C++ (C# will give you and your users a lot of pain) for it, and you will need to "hook" SHFileOperation through something like ICopyHook. Start by taking a look at ICopyHook. It will be a lot of work and a lot of learning, and I don't think it's worth it, but there's the info. Good luck.

how to save user registration in the exe... (C#)

Is this even possible?
I realize that asking them to enter data when the program runs and saving it in the executable file itself is out. (Or is it?)
Right now I'm considering trying to build the program server-side with php and have it incorporate a separate text file which would contain the information. This seems marginally feasible, though I would have quite a bit of learning to accomplish it.
I was hoping for some other ideas of how I might accomplish this.
I am not interested in separate configuration or text files or putting data in windows registry. I am only looking for solutions where it can be quite-solidly a part of the executable.
Does anybody have any experience with this?
Thank you.
Its perfectly possible, that's how self-extracting zip files work.
Basically, you can add as much stuff to the end of the executable file as you want. Your program can then open its own file up on disk and read it back.
How about using Settings within your app? It depends on what you mean by "storing the user registration" as to how you would best achieve this, though. If you could give some more information about what you actually want to store, that would be useful.
An example would be to save a username, or an authentication token, and use that each time you need to check a "registration". As I say, though, the details of what to store would depend entirely on what you want to do it that data...
You could use it to embed in the unmanaged resources.

Categories

Resources