Results 1 to 10 of 10

Thread: Moving a folder from the resources.. possible?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2010
    Posts
    23

    Moving a folder from the resources.. possible?

    Title says it all.. I have a folder in the resources called 'files', which contains sub folders which I want to move into another directory.. I searched but found nothing, any ideas?

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Moving a folder from the resources.. possible?

    I think that you have misunderstood what resources are. When you add resources to your project the originals will appear in a folder in the Solution Explorer because they are source files. When you build your project though, just like your code files, those resources are compiled into the final EXE. That's the whole point of resources: they are part of your executable file, not separate files on their own.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jun 2010
    Posts
    23

    Re: Moving a folder from the resources.. possible?

    Hmm, Alright.. only started VB.net a few days ago, so still learning these things. Is there any other way to put these files into the .EXE? I don't really want to be adding other folders to my download.

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Moving a folder from the resources.. possible?

    Again, that's the whole point of resources. The files ARE part of your EXE. There are no extra folders.

    Ideally, in VB 2005 and later, you should add your resources via the Resources page of the project properties rather than via the Solution Explorer. You can then access them in code via My.Resources.

    Regardless of how you add them, there are no extra folders and there are no extra files. When you build your project, the resources are compiled into the EXE file.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Jun 2010
    Posts
    23

    Re: Moving a folder from the resources.. possible?

    Alright, it works when I use the resources page.. just wasn't working when I was dragging the files into the resources tab on the right column, thanks!

  6. #6

    Thread Starter
    Junior Member
    Join Date
    Jun 2010
    Posts
    23

    Re: Moving a folder from the resources.. possible?

    Sorry for double post, but just to clarify that you cannot use folders in resources? If not, is there any other approach I could take in order to get all my files (100+) in the single EXE? (I wanted them in the folder because it would be easier moving a directory than a single file)

  7. #7
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Moving a folder from the resources.. possible?

    Add all your resources and then, when you build your project, all your resources ARE part of the EXE. That's the whole point of resources: that they are part of the EXE.

    As for adding multiple resources, simply select multiple files when adding a resource. You can add your resources as files in the Solution Explorer and then set their Build Action to Embedded Resource but you're simply making your life harder because accessing them in code is more cumbersome. If you add them on the Resources page of the project properties then you can access them easily using My.Resources.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  8. #8

    Thread Starter
    Junior Member
    Join Date
    Jun 2010
    Posts
    23

    Re: Moving a folder from the resources.. possible?

    I understand that adding files into the resources will add them into the .EXE, but what I'm wondering is if I can add a folder in the project properties, then put all my modified files in there.

    I do understand the concept of My.Resources, but like I said in my previous post, I have over 100 files, and they can be renamed after every release, it would be much easier if I could move the folder within the resources to the game directory.

    Ex: Directory.Move(My.Resources.files, GameDir)

  9. #9

    Thread Starter
    Junior Member
    Join Date
    Jun 2010
    Posts
    23

    Re: Moving a folder from the resources.. possible?

    Anyone..?

  10. #10
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Moving a folder from the resources.. possible?

    It does not look like that is the case... Now... what you COULD do... zip up your folder.. Add the ZIP file... then your app would be able to copy the zip file out of resources, where you could then extract the files and put them where they belong.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width