Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Browse the directory system

Browse the directory system

Scheduled Pinned Locked Moved Visual Basic
csharpxmlhelptutorialquestion
19 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    ArchaBhandare
    wrote on last edited by
    #1

    Hello, I need help in my VB application. I have a 'Browse' button in my application's properties page, which should help me to browse through the directory system to choose a directory to save the xml files into. How to I get the directory system when I click on browse. In C# we have the 'FolderBrowserDialog' , do we have something like that in VB. Also how do I save files into the directory choosen by 'browse'

    S 1 Reply Last reply
    0
    • A ArchaBhandare

      Hello, I need help in my VB application. I have a 'Browse' button in my application's properties page, which should help me to browse through the directory system to choose a directory to save the xml files into. How to I get the directory system when I click on browse. In C# we have the 'FolderBrowserDialog' , do we have something like that in VB. Also how do I save files into the directory choosen by 'browse'

      S Offline
      S Offline
      sathesh pandian
      wrote on last edited by
      #2

      yes. In vb.net we have the same 'FolderBrowserDialog'. you can use it for the folder selection.

      Sathesh Pandian

      A 1 Reply Last reply
      0
      • S sathesh pandian

        yes. In vb.net we have the same 'FolderBrowserDialog'. you can use it for the folder selection.

        Sathesh Pandian

        A Offline
        A Offline
        ArchaBhandare
        wrote on last edited by
        #3

        I am not using VB.NET. My application is in plain VB. it is VB 6.0 from Visual Studio 6.0.. I tried to convert it to Visual Studio 2005, but then there were many other issues seen while running the application. Can you please help me with something in VB

        S 1 Reply Last reply
        0
        • A ArchaBhandare

          I am not using VB.NET. My application is in plain VB. it is VB 6.0 from Visual Studio 6.0.. I tried to convert it to Visual Studio 2005, but then there were many other issues seen while running the application. Can you please help me with something in VB

          S Offline
          S Offline
          sathesh pandian
          wrote on last edited by
          #4

          k tell me. what problems you are facing now?

          Sathesh Pandian

          A 1 Reply Last reply
          0
          • S sathesh pandian

            k tell me. what problems you are facing now?

            Sathesh Pandian

            A Offline
            A Offline
            ArchaBhandare
            wrote on last edited by
            #5

            This is an enhancement to the already existing project. I want to enter a directory path to save some files. I want the user the choose the directory. For this I have introduced the 'Browse' button in the code. But I dont know how the directory structure will be seen on clicking on Browse. I tried just entered this line of code ' Dim theFolderBrowser As New FolderBrowserDialog ' and executed the application. But on clicking on 'Browse' it said the User-defined variable is not supported. How can I have the dirctory structure visible. I am using plain VB

            S D 2 Replies Last reply
            0
            • A ArchaBhandare

              This is an enhancement to the already existing project. I want to enter a directory path to save some files. I want the user the choose the directory. For this I have introduced the 'Browse' button in the code. But I dont know how the directory structure will be seen on clicking on Browse. I tried just entered this line of code ' Dim theFolderBrowser As New FolderBrowserDialog ' and executed the application. But on clicking on 'Browse' it said the User-defined variable is not supported. How can I have the dirctory structure visible. I am using plain VB

              S Offline
              S Offline
              sathesh pandian
              wrote on last edited by
              #6

              after that you can try like this... for VS 2005 if theFolderBrowser.showdialog= Windows.Forms.DialogResult.OK Then filename=theFolderBrowser.filename end if For VS 2003 if theFolderBrowser.showdialog= DialogResult.OK Then filename=theFolderBrowser.filename end if

              Sathesh Pandian

              A 1 Reply Last reply
              0
              • S sathesh pandian

                after that you can try like this... for VS 2005 if theFolderBrowser.showdialog= Windows.Forms.DialogResult.OK Then filename=theFolderBrowser.filename end if For VS 2003 if theFolderBrowser.showdialog= DialogResult.OK Then filename=theFolderBrowser.filename end if

                Sathesh Pandian

                A Offline
                A Offline
                ArchaBhandare
                wrote on last edited by
                #7

                Thanx, I got the thing working

                S 1 Reply Last reply
                0
                • A ArchaBhandare

                  Thanx, I got the thing working

                  S Offline
                  S Offline
                  sathesh pandian
                  wrote on last edited by
                  #8

                  if you have any doubts, send your queries to me. i will surely help you.

                  Sathesh Pandian

                  A 1 Reply Last reply
                  0
                  • S sathesh pandian

                    if you have any doubts, send your queries to me. i will surely help you.

                    Sathesh Pandian

                    A Offline
                    A Offline
                    ArchaBhandare
                    wrote on last edited by
                    #9

                    I had another query When I send the data to the server, the server forms an xml of the data and sends me the url to that xml. Now, I am needed to save this xml into a particular directory(already known). How to I read and save this file ? I am not having a trace of the flow with me, so I dont have an idea how I will get the data in the xml and furthur will save it. Can anyone help me to know how can I read the xml from the url to the xml and how do I save this file into a directory

                    S 1 Reply Last reply
                    0
                    • A ArchaBhandare

                      I had another query When I send the data to the server, the server forms an xml of the data and sends me the url to that xml. Now, I am needed to save this xml into a particular directory(already known). How to I read and save this file ? I am not having a trace of the flow with me, so I dont have an idea how I will get the data in the xml and furthur will save it. Can anyone help me to know how can I read the xml from the url to the xml and how do I save this file into a directory

                      S Offline
                      S Offline
                      sathesh pandian
                      wrote on last edited by
                      #10

                      you can try this you know filename that is the url you also know the directory path (savepath) Dim xmlDoc As New XmlDocument xmlDoc.Load(filename) xmldoc.save(Savepath)

                      Sathesh Pandian

                      A 1 Reply Last reply
                      0
                      • S sathesh pandian

                        you can try this you know filename that is the url you also know the directory path (savepath) Dim xmlDoc As New XmlDocument xmlDoc.Load(filename) xmldoc.save(Savepath)

                        Sathesh Pandian

                        A Offline
                        A Offline
                        ArchaBhandare
                        wrote on last edited by
                        #11

                        for the filename I will have to specify the whole path on the network system right ? I mean the xml will be on the server, so it will be \\ am I correct ?

                        S 1 Reply Last reply
                        0
                        • A ArchaBhandare

                          for the filename I will have to specify the whole path on the network system right ? I mean the xml will be on the server, so it will be \\ am I correct ?

                          S Offline
                          S Offline
                          sathesh pandian
                          wrote on last edited by
                          #12

                          is it physical path or virtual path? if it is a valid path you can use tht link in the filename.

                          Sathesh Pandian

                          A 1 Reply Last reply
                          0
                          • S sathesh pandian

                            is it physical path or virtual path? if it is a valid path you can use tht link in the filename.

                            Sathesh Pandian

                            A Offline
                            A Offline
                            ArchaBhandare
                            wrote on last edited by
                            #13

                            Sorry, What does a physical path or virtual path mean? The server is expected to send something like 'www.server1.com\file.xml' This is just an assumption, as we dont have the server implementation done and so cant get the actual packet trace.

                            S A 2 Replies Last reply
                            0
                            • A ArchaBhandare

                              Sorry, What does a physical path or virtual path mean? The server is expected to send something like 'www.server1.com\file.xml' This is just an assumption, as we dont have the server implementation done and so cant get the actual packet trace.

                              S Offline
                              S Offline
                              sathesh pandian
                              wrote on last edited by
                              #14

                              ok you can use the load method like this xmldoc.load("www.samples.com\1.xml") no problem with this.

                              Sathesh Pandian

                              A 1 Reply Last reply
                              0
                              • A ArchaBhandare

                                Sorry, What does a physical path or virtual path mean? The server is expected to send something like 'www.server1.com\file.xml' This is just an assumption, as we dont have the server implementation done and so cant get the actual packet trace.

                                A Offline
                                A Offline
                                ArchaBhandare
                                wrote on last edited by
                                #15

                                For better understanding, presently the server is responding with an URL pointing to the shopping cart which is then opened in the browser. These urls are in the form like http://www.abc.com/ The application now wants the server to form xmls and send an URL pointing to the XML, back to the client. I dont know how the client will get it back, I think it should be like 'www.server1.com\file.xml' or 'http://www.abc.com/file.xml' Do you have any idea how it will be like. and Also the main point is that I should be able to save that xml file into the directory

                                S 1 Reply Last reply
                                0
                                • S sathesh pandian

                                  ok you can use the load method like this xmldoc.load("www.samples.com\1.xml") no problem with this.

                                  Sathesh Pandian

                                  A Offline
                                  A Offline
                                  ArchaBhandare
                                  wrote on last edited by
                                  #16

                                  For better understanding, presently the server is responding with an URL pointing to the shopping cart which is then opened in the browser. These urls are in the form like http://www.abc.com/ The application now wants the server to form xmls and send an URL pointing to the XML, back to the client. I dont know how the client will get it back, I think it should be like 'www.server1.com\file.xml' or 'http://www.abc.com/file.xml' Do you have any idea how it will be like. and Also the main point is that I should be able to save that xml file into the directory

                                  1 Reply Last reply
                                  0
                                  • A ArchaBhandare

                                    For better understanding, presently the server is responding with an URL pointing to the shopping cart which is then opened in the browser. These urls are in the form like http://www.abc.com/ The application now wants the server to form xmls and send an URL pointing to the XML, back to the client. I dont know how the client will get it back, I think it should be like 'www.server1.com\file.xml' or 'http://www.abc.com/file.xml' Do you have any idea how it will be like. and Also the main point is that I should be able to save that xml file into the directory

                                    S Offline
                                    S Offline
                                    sathesh pandian
                                    wrote on last edited by
                                    #17

                                    you can try like this only "http:\\www.samples.com\like.xml"

                                    Sathesh Pandian

                                    A 1 Reply Last reply
                                    0
                                    • S sathesh pandian

                                      you can try like this only "http:\\www.samples.com\like.xml"

                                      Sathesh Pandian

                                      A Offline
                                      A Offline
                                      ArchaBhandare
                                      wrote on last edited by
                                      #18

                                      How do I check if a folder already exists on the system without including any classes? I dont know why the Try-Catch block does not work in my code. It gives compilation error that try is not excepted

                                      1 Reply Last reply
                                      0
                                      • A ArchaBhandare

                                        This is an enhancement to the already existing project. I want to enter a directory path to save some files. I want the user the choose the directory. For this I have introduced the 'Browse' button in the code. But I dont know how the directory structure will be seen on clicking on Browse. I tried just entered this line of code ' Dim theFolderBrowser As New FolderBrowserDialog ' and executed the application. But on clicking on 'Browse' it said the User-defined variable is not supported. How can I have the dirctory structure visible. I am using plain VB

                                        D Offline
                                        D Offline
                                        Dave Kreskowiak
                                        wrote on last edited by
                                        #19

                                        There is no FolderBrowserDialog in VB6. You have to make your own from scratch. It's a bad idea to look at C# or VB.NET code and try to convert it to VB6. There is SO MUCH that the .NET Framework supplies, like the FolderBrowserDialog class, that you have to recreate from scratch that it makes using VB6 nearly impossible because of the time you'll waste reinventing everything you see C# and VB.NET using in the .NET Base Class Library.

                                        Dave Kreskowiak Microsoft MVP - Visual Basic

                                        1 Reply Last reply
                                        0
                                        Reply
                                        • Reply as topic
                                        Log in to reply
                                        • Oldest to Newest
                                        • Newest to Oldest
                                        • Most Votes


                                        • Login

                                        • Don't have an account? Register

                                        • Login or register to search.
                                        • First post
                                          Last post
                                        0
                                        • Categories
                                        • Recent
                                        • Tags
                                        • Popular
                                        • World
                                        • Users
                                        • Groups