Results 1 to 6 of 6

Thread: [RESOLVED] Does anyone here know how to...

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 2006
    Posts
    54

    Resolved [RESOLVED] Does anyone here know how to...

    open a folder with a click of a button?... im trying to develop an autorun cd application using vb.net which includes a "browse this cd" button, im a beginner so i cant seem to figure out how to do it...

    Last edited by fantasy2ville; Apr 22nd, 2007 at 08:29 PM. Reason: to emphasize the point

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

    Re: Does anyone here know how to...

    That's not such a good idea because if the CD is intended to install your app then there's no guarantee that they'll have the .NET Framework installed when the insert the disc. If that's the case then your app will never run and the user will get a cryptic error message.

    All that aside, you browse for folders using a FolderBrowserDialog and files using an OpenFileDialog. That wouldn't be appropriate in your case though. What you want is for a Windows Explorer window to open rooted at the optical drive. That would be:
    vb Code:
    1. Process.Start(IO.Path.GetPathRoot(Application.StartupPath))
    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
    Member
    Join Date
    Nov 2006
    Posts
    54

    Re: Does anyone here know how to...

    well, yeah... im really intending an explorer window to open so that the user can do the "explore the contents of the cd" thing

    my autorun application doesnt really intend to install another application but it should only serve as a startup screen.... but i really didnt get what you said... does that mean that the applications im developing in vb.net would only run in a pc with a .Net framework?

  4. #4
    Hyperactive Member cptHotkeys's Avatar
    Join Date
    Apr 2007
    Location
    New Zealand
    Posts
    294

    Wink Re: Does anyone here know how to...

    well yes any application you make in VB.net will require the dot net framework, but there is a way around this.
    when you burn this cd also burn the dotnet framework redistributable version.
    Then before the dotnet app runs, run a script to check if the framwork is installed, if it is run your app, otherwise install the framework.
    There are scripts on the net for this exact purpose, do a google for one...
    So yeah run the script from auto run and run your app from the script, it will ony require one line of code to run your app, and one to install the framwork, so if you find the right script it will be easy...

  5. #5

    Thread Starter
    Member
    Join Date
    Nov 2006
    Posts
    54

    Re: Does anyone here know how to...

    well, that's such a hassel, making a startup form and require the user to install a .net framework would require alot of memory space... maybe i should try vb6.0 instead... thanks for the responses anyway... i could still use the code for future reference

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

    Re: Does anyone here know how to...

    Quote Originally Posted by fantasy2ville
    does that mean that the applications im developing in vb.net would only run in a pc with a .Net framework?
    Exactly. ALL .NET apps require the .NET Framework to be installed or they won't run. There are various good reasons for this that I won't go into here. There are numerous threads about this on the forum and plenty of information available on the Web.
    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

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