How to make an ImageList of a folder from the internet? - vb.net

I have looked everywhere for the answer but couldn't find it. What I am trying to do is take a folder of Google Drive and put it into my image list. The folder is a shared folder so I am uncertain if I can just use the Google Drive folder on my computer that is used for syncing to my Drive.

Accordingly to the comment posted by #jmcilhinney.
This is a classic case of a question that needs more focus, i.e. it's
really a combination of multiple questions. Creating and populating an
ImageList is the same no matter where the images come from. Your
question is whether multiple machines can see the same cloud drive,
which probably doesn't even have anything to do with VB.NET or
programming at all. If you can map that folder locally on two machines
then you have your answer about whether multiple users can see the
same folder. If you can access any file in that folder in VB.NET then
you know that your app can do that. That's it done.

Related

How can I get all of the files in C: drive with Directory.GetFiles?

So, I have been trying to get all of the C: drive files with Directory.GetFiles, but I had no success. And yes, i'm a starter at VB.NET. Anybody know how to get all of the files from C: drive? (I'm only finding .exe files here)
Its quite an in-depth project to accomplish, however, it is not too difficult once you get your head around the fundamentals. So definitely go for it!
Start off with directories - see Get directories
The Files - see Get files
Rather than scanning the whole of your C: drive, start off with creating a folder and putting some folders and files in there to test with.
You can use the SearchPattern to search *.exe for your current requirement, or t*.d would return "Test.docx" as well as "template.dll" (if they are in the folder you are searching
Use ListBox if you are familiar with them to show results. Keep googling! - There's lots of articles out there, the more you code.. and get wrong.. - The better you'll become!

Different letters for shared drives

Quick Background: I write excel macros for a company that uses shared drives on the network to share information between employees
The Problem: Different employees have the same shared drive listed under separate letters. For example Susie has the "Commissions Shared Drive" as drive "Z" but Betty has it as drive "x".
I'll design a macro that two different people use and the macro runs into errors because they have separate drive letters. To put it simply, the file locations written in the code won't be correct for both people due to the difference of drive letter.
The Current Solution: I currently have a copy of the exact same macro with changes made to the file locations to account for the difference of drive letter. This is annoying because anytime I make changes to the one file I have to ensure the other is exactly the same.
The Question: Is there a way I can account for different drive letters in one macro so I don't have to have duplicates of the file with different addresses?
Thanks in Advance!
-Mike
Use the actual network path.
For instance instead of something like
Z:\filename
Use
\\servername\foldername\filename
As long as the user has access to the path, the code will find it regardless of drive mapping.
Edit:
You can view this question and its answers for some great reasons why you should not use the mapped drive letters in your code.
As a side note, if you were using something less updatable then an Excel macro, it would be a good idea to not actually store the path in your code at all. Instead you would have a file that the code views to obtain the path. Thereby what you write will work far longer without having to be recompiled or revised. But again, since you're just doing an Excel macro I see no compelling reason not to use the direct path.
#Daniel Cook I also found another path that you can use to refer to a shared drive.
If you right click on the shared drive and go to properties > DFS (DFS is a tab in the properties window) they list a separate path there that works. I created a macro to test both paths and both worked.
However, one of my associates said he made a macro for another employee using the path method of \servername\foldername\filename and it didn't work on her computer for some reason, but when he used the other pathway found in the DFS tab under the shared drive's properties it worked for her.
Any ideas why the \servername\foldername\filename path might work on one computer and not another?

VB.NET Allow user to choose directory to save multiple files to

I know how to open/save files, ect and do fairly well with programming. I am not a pro, but I get the job done. I know quite a bit, and am good with using Google to find my answers.
Maybe it is because I am pretty tired right now, or I am not sure what exactly I am looking for to put into Google correctly...
I am needing to allow the user to choose a directory to save in. They can create a new directory if they want/need, and once they choose the directory, my program will save a few pre-coded files into that directory.
I don't think this would use the OpenFileDialog. Thank you in advance!
What you seek is the folder select dialog. It lets the user do all the stuff you are loking for.

Access images contained within Solution Explorer

I'm trying to access some images I've copied into a folder within Solution Explorer. For the life of me I can't figure out how to access them programmatically. The only other question I found that appeared similar was not answered. Any help would be appreciated.
I'm using VB 2010 Express Edition. The folder name is 'Images'. The image name is 'checked.png'.
Unless you put them as resources, you cannot. They are just like any other source file in your application.
Import them as a resource, and then you'll be good to go.
http://support.microsoft.com/kb/319291

Is there a way to change user desktop directory path value in Cocoa?

I know there is NSDesktopDirectory that will get me the path to current user desktop directory, but where is this path value written and is there a way to change it from my cocoa application I cannot find out.
Can anyone point me in the right direction?
Additional explanation: in Snow Leopard when I rename Desktop folder to anything whatsoever, the content of this folder still shows on desktop, so I guess OS keeps track about that folder name and locations changes and keep it as desktop folder. Does anyone know how it does that?
One way you could do this is by storing whole set of files from the user's desktop (including .DS_Store, which has positional/spatial information) into a folder in your ~/Library/Application Support/ folder, then moving other files on the ~/Desktop? This should effectively "replace" the user's desktop.
[Posted as an answer as suggested above]
I spent about 40 minutes researching this out of curiosity. Google is unhelpful in this particular scenario so I poked around my ~/Library folder. The path isn't stored anywhere there. I then dug around with command-line-fu to check flags and any other metadata I could find. Nothing helpful.
I think this is a built-in thing that uses file system references as opposed to hard-coded file paths (which is why its "Desktop" designation survives renaming). If you delete it, it creates a new one and stores the ref to that one. You'll not be able to swap it around.
I think Phil's comment is probably your best bet: move the contents of the folder rather than the folder itself. Here's my take on it:
~/Desktop/.myDesktop1 ... ~/Desktop/.myDesktop2 ... ~/Desktop/.myDesktop3
Perhaps even: ~/Desktop/.myappdesktops/1 ~/Desktop/.myappdesktops/2 ~/Desktop/.myappdesktops/3
If you move stuff into a dot-folder, it'll remain hidden but there. Active stuff stays in ~/Desktop as normal but each of your conceptual "Desktops" gets stored in a dot-file so it stays hidden.
Caveat: Time Machine. :-) Regardless of your approach, swapping out "sets" of files will potentially wreak havoc with any backup solution.
So, to answer my own question: there is no way to change the desktop path in Snow Leopard or Lion (although you van read it). The only way to switch dasktops is moving the contents itself which can be done with a set of AppleScripts to some degree :(.
The other way is this app here :)):
http://itunes.apple.com/us/app/projectdesktops/id499870251?ls=1&mt=12