FSO equivalent in VB.net

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ben

    FSO equivalent in VB.net

    Hi all,

    I have been using the FSO object in in my Excel/ Access and VB 6 development
    from the ScriptingRuntim e library. I am just starting to use a VS 2002 and
    VS 2005 Express. I am wondering if there is something equivalent in VS 2002
    and later or how I can correctly use it? Thanks for sharing your thoughts
    and suggestions.

    Ben

  • Michael C

    #2
    Re: FSO equivalent in VB.net

    "Ben" <Ben@discussion s.microsoft.com wrote in message
    news:ADA78080-ECB7-460E-99FD-40C0CD4A7FBA@mi crosoft.com...
    Hi all,
    >
    I have been using the FSO object in in my Excel/ Access and VB 6
    development
    from the ScriptingRuntim e library. I am just starting to use a VS 2002
    and
    VS 2005 Express. I am wondering if there is something equivalent in VS
    2002
    and later or how I can correctly use it? Thanks for sharing your thoughts
    and suggestions.
    Have a look in the System.IO namespace
    >
    Ben
    >

    Comment

    • Cor Ligthert [MVP]

      #3
      Re: FSO equivalent in VB.net

      Ben,

      There is so much that it is almost impossible to point you.
      Just tell us what you want to do, than we can give you a better answer.
      Although the IO class as Michael showed you is of course as well a good
      starting direction.

      Cor

      "Ben" <Ben@discussion s.microsoft.com schreef in bericht
      news:ADA78080-ECB7-460E-99FD-40C0CD4A7FBA@mi crosoft.com...
      Hi all,
      >
      I have been using the FSO object in in my Excel/ Access and VB 6
      development
      from the ScriptingRuntim e library. I am just starting to use a VS 2002
      and
      VS 2005 Express. I am wondering if there is something equivalent in VS
      2002
      and later or how I can correctly use it? Thanks for sharing your thoughts
      and suggestions.
      >
      Ben
      >

      Comment

      • RobinS

        #4
        Re: FSO equivalent in VB.net

        Check out the FileInfo and DirectoryInfo classes.

        As Cor said, if you give us an idea what you're trying to do,
        we can make more precise suggestions.

        Robin S.
        -----------------------
        "Ben" <Ben@discussion s.microsoft.com wrote in message
        news:ADA78080-ECB7-460E-99FD-40C0CD4A7FBA@mi crosoft.com...
        Hi all,
        >
        I have been using the FSO object in in my Excel/ Access and VB 6
        development
        from the ScriptingRuntim e library. I am just starting to use a VS 2002
        and
        VS 2005 Express. I am wondering if there is something equivalent in VS
        2002
        and later or how I can correctly use it? Thanks for sharing your thoughts
        and suggestions.
        >
        Ben
        >

        Comment

        • aaron.kempf@gmail.com

          #5
          Re: FSO equivalent in VB.net

          it's not possible.. comparing vb6 to vb.net is like trying to call a
          Windows API on a MAC.
          it just doesn't work.

          VB.net sucks run away while you still can.

          Sorry; but I was in the same boat as you for a long time; and finally
          realized that VB.net does NOTHING PRODUCTIVE except take an extra 10
          seconds to launch.

          ..NET isn't even ready for production use; nobody can even tell me a
          simple standard way to determine which version of the framework is on
          machine X

          they all ask 'oh what version of Windows' and 'oh what version do you
          have installed' and 'under add/remove programs what version shows up'

          and the punchline is that NOBODY CONSIDERED THIS DURING THE DESIGN
          PHASE FOR THE FIRST VERSION OF .NET AND THEY STILL HAVENT FIXED THE
          FUCKING PROBLEM.

          You have to ask 30 questions before you can figure out 'what version of
          the framework is on machine X'

          the bottom line is that MS is going to kill VB.net anyways; so I'd just
          run away to PHP or something

          -Aaron



          Ben wrote:
          Cor, Robin -
          >
          I have been using FSO to test for file/directory existence and creation in
          place of VB and VBA's built-in function. I love the flexibility and the
          sytnax is more intuitive.
          >
          That is what I am hoping to do. Thanks guys.
          >
          Ben
          >
          --
          >
          >
          >
          "Cor Ligthert [MVP]" wrote:
          >
          Ben,

          There is so much that it is almost impossible to point you.
          Just tell us what you want to do, than we can give you a better answer.
          Although the IO class as Michael showed you is of course as well a good
          starting direction.

          Cor

          "Ben" <Ben@discussion s.microsoft.com schreef in bericht
          news:ADA78080-ECB7-460E-99FD-40C0CD4A7FBA@mi crosoft.com...
          Hi all,
          >
          I have been using the FSO object in in my Excel/ Access and VB 6
          development
          from the ScriptingRuntim e library. I am just starting to use a VS 2002
          and
          VS 2005 Express. I am wondering if there is something equivalent in VS
          2002
          and later or how I can correctly use it? Thanks for sharing your thoughts
          and suggestions.
          >
          Ben
          >

          Comment

          • Tom Shelton

            #6
            Re: FSO equivalent in VB.net

            On 2006-12-05, Ben <Ben@discussion s.microsoft.com wrote:
            Cor, Robin -
            >
            I have been using FSO to test for file/directory existence and creation in
            place of VB and VBA's built-in function. I love the flexibility and the
            sytnax is more intuitive.
            >
            That is what I am hoping to do. Thanks guys.
            >
            Ben
            >
            Imports System.IO

            ....

            If File.Exists(pat hToFile) Then
            ' Do Cool Stuff
            End If

            If Directory.Exist s (pathToDirector y) Then
            ' Do Cool stuff
            End If

            HTH,

            --
            Tom Shelton

            Comment

            • Branco Medeiros

              #7
              Re: FSO equivalent in VB.net

              Ben wrote:
              <snip>
              I have been using FSO to test for file/directory existence and creation in
              place of VB and VBA's built-in function. I love the flexibility and the
              sytnax is more intuitive.
              >
              That is what I am hoping to do. Thanks guys.
              <snip>

              to which aaron.kempf@gma il.com replied:
              it's not possible..
              <snip>
              Sorry; but I was in the same boat as you for a long time; and finally
              realized that VB.net does NOTHING PRODUCTIVE except take an extra 10
              seconds to launch.
              <snip>

              I don't agree. I've been using VB from version 1.0 up to 6.0, and
              resisted VB.Net a lot. But VB.Net 2005 won me over (even though I hate
              the so called verbosity, the silly choice of keyword naming, and so
              many other irritating things).

              I started using VB Express to develop a few internal projects -- to
              replace some Delphi inheritance we have here -- and become amazed by
              the quality of the the results (yes, the compiler really sucks, but you
              become used to it). I even managed to convince the powers that be here
              to acquire Visual Studio 2005, so our bigger projects are being done in
              VB.Net, now. With no regrets.

              The turning point really happened when I was to test some ideas against
              SQL Server and, instead of using good old VB.Classic as I usually did
              for snippets and short tests, I went straight to VB.Net, without even
              noticing.

              Well, but I'm digressing. You'll find all sort of goodies in the
              System.IO.File/Directory/Path classes. Hope you have fun.

              Regards,

              Branco.

              Comment

              • Cor Ligthert [MVP]

                #8
                Re: FSO equivalent in VB.net

                Ben,

                In this page you see in extention to Tom, as well how to create a directory.

                Exposes static methods for creating, moving, and enumerating through directories and subdirectories. This class cannot be inherited.


                I hope this helps,

                Cor

                "Tom Shelton" <tom_shelton@co mcastXXXXXXX.ne tschreef in bericht
                news:dKCdnQYFEd srvevYnZ2dnUVZ_ rKdnZ2d@comcast .com...
                On 2006-12-05, Ben <Ben@discussion s.microsoft.com wrote:
                >Cor, Robin -
                >>
                >I have been using FSO to test for file/directory existence and creation
                >in
                >place of VB and VBA's built-in function. I love the flexibility and the
                >sytnax is more intuitive.
                >>
                >That is what I am hoping to do. Thanks guys.
                >>
                >Ben
                >>
                >
                Imports System.IO
                >
                ...
                >
                If File.Exists(pat hToFile) Then
                ' Do Cool Stuff
                End If
                >
                If Directory.Exist s (pathToDirector y) Then
                ' Do Cool stuff
                End If
                >
                HTH,
                >
                --
                Tom Shelton

                Comment

                • aaron.kempf@gmail.com

                  #9
                  Re: FSO equivalent in VB.net

                  yeah.. is that syntax COMPATIBLE WITH VB6?

                  WHY IN THE HELL IS IT 180 DEGREES DIFFERENT?

                  the answer is that MS gets a failing grade; and it's not practical to
                  convert FSO to vb.net.
                  How about you just continue to use FSO in vb.net?

                  Like seriously here.
                  Dont rewrite; keep things intact.


                  -Aaron



                  Tom Shelton wrote:
                  On 2006-12-05, Ben <Ben@discussion s.microsoft.com wrote:
                  Cor, Robin -

                  I have been using FSO to test for file/directory existence and creation in
                  place of VB and VBA's built-in function. I love the flexibility and the
                  sytnax is more intuitive.

                  That is what I am hoping to do. Thanks guys.

                  Ben
                  >
                  Imports System.IO
                  >
                  ...
                  >
                  If File.Exists(pat hToFile) Then
                  ' Do Cool Stuff
                  End If
                  >
                  If Directory.Exist s (pathToDirector y) Then
                  ' Do Cool stuff
                  End If
                  >
                  HTH,
                  >
                  --
                  Tom Shelton

                  Comment

                  • Ben

                    #10
                    Re: FSO equivalent in VB.net

                    Tom, Cor -

                    Thank you both. That definitely helps.

                    Ben

                    --



                    "Ben" wrote:
                    Cor, Robin -
                    >
                    I have been using FSO to test for file/directory existence and creation in
                    place of VB and VBA's built-in function. I love the flexibility and the
                    sytnax is more intuitive.
                    >
                    That is what I am hoping to do. Thanks guys.
                    >
                    Ben
                    >
                    --
                    >
                    >
                    >
                    "Cor Ligthert [MVP]" wrote:
                    >
                    Ben,

                    There is so much that it is almost impossible to point you.
                    Just tell us what you want to do, than we can give you a better answer.
                    Although the IO class as Michael showed you is of course as well a good
                    starting direction.

                    Cor

                    "Ben" <Ben@discussion s.microsoft.com schreef in bericht
                    news:ADA78080-ECB7-460E-99FD-40C0CD4A7FBA@mi crosoft.com...
                    Hi all,
                    >
                    I have been using the FSO object in in my Excel/ Access and VB 6
                    development
                    from the ScriptingRuntim e library. I am just starting to use a VS 2002
                    and
                    VS 2005 Express. I am wondering if there is something equivalent in VS
                    2002
                    and later or how I can correctly use it? Thanks for sharing your thoughts
                    and suggestions.
                    >
                    Ben
                    >

                    Comment

                    • aaron.kempf@gmail.com

                      #11
                      Re: FSO equivalent in VB.net

                      VB.net has no benefit of VB6.

                      VB.net is going away.

                      VB.net might as well be named 'the ugly red-headed stepchild to C#'
                      VB.net might as well be named 'the ugly red-headed stepchild to C#'
                      VB.net might as well be named 'the ugly red-headed stepchild to C#'
                      VB.net might as well be named 'the ugly red-headed stepchild to C#'

                      If you're going to use .NET learn C# instead of VB.net

                      VB 2005 won me over also-- for a couple of months.

                      when I realized that I couldnt' deliver projects in the same ballpark
                      as VB6; i fell off the wagon.

                      yes; it has some nice features.
                      but I don't see any compelling reason to buy into MS .Net strategy.
                      The only benefit is that you're tied to Windows.

                      I would rather use PHP.
                      PHP is by far the worlds most popular languages these days; at least
                      for web development www.netcraft.com

                      -Aaron




                      Branco Medeiros wrote:
                      Ben wrote:
                      <snip>
                      I have been using FSO to test for file/directory existence and creation in
                      place of VB and VBA's built-in function. I love the flexibility and the
                      sytnax is more intuitive.

                      That is what I am hoping to do. Thanks guys.
                      <snip>
                      >
                      to which aaron.kempf@gma il.com replied:
                      >
                      it's not possible..
                      <snip>
                      Sorry; but I was in the same boat as you for a long time; and finally
                      realized that VB.net does NOTHING PRODUCTIVE except take an extra 10
                      seconds to launch.
                      <snip>
                      >
                      I don't agree. I've been using VB from version 1.0 up to 6.0, and
                      resisted VB.Net a lot. But VB.Net 2005 won me over (even though I hate
                      the so called verbosity, the silly choice of keyword naming, and so
                      many other irritating things).
                      >
                      I started using VB Express to develop a few internal projects -- to
                      replace some Delphi inheritance we have here -- and become amazed by
                      the quality of the the results (yes, the compiler really sucks, but you
                      become used to it). I even managed to convince the powers that be here
                      to acquire Visual Studio 2005, so our bigger projects are being done in
                      VB.Net, now. With no regrets.
                      >
                      The turning point really happened when I was to test some ideas against
                      SQL Server and, instead of using good old VB.Classic as I usually did
                      for snippets and short tests, I went straight to VB.Net, without even
                      noticing.
                      >
                      Well, but I'm digressing. You'll find all sort of goodies in the
                      System.IO.File/Directory/Path classes. Hope you have fun.
                      >
                      Regards,
                      >
                      Branco.

                      Comment

                      • Branco Medeiros

                        #12
                        Re: FSO equivalent in VB.net

                        aaron.kempf@gma il.com wrote (inline):
                        VB.net has no benefit of VB6.
                        It allows me to program .Net in a case insensitive language that
                        doesn't use "{" "}" as block delimeters or ";" as statement terminator.
                        =)

                        <snip>
                        VB 2005 won me over also-- for a couple of months.
                        >
                        when I realized that I couldnt' deliver projects in the same ballpark
                        as VB6; i fell off the wagon.
                        >
                        yes; it has some nice features.
                        but I don't see any compelling reason to buy into MS .Net strategy.
                        The only benefit is that you're tied to Windows.
                        *I am* tied to Windows, all right -- at least here, at my job. VB.Net
                        is clumsy, the compiler is slow, edit n' continue is ridiculous
                        (compared to what VB.classic provided), but, on the other side, I have:

                        a) A powerfull object oriented language. Inheritance rulez, I'd say, if
                        I was not this old. This alone would have been a reason to migrate to
                        VB.Net if it wasn't for the childish approach to naming the related
                        keywords... I hate the "MustInheri t", "NotInheritable ", etc
                        mambo-jambo. I'd really prefer the "official" terms, such as
                        "Abstract", "Final", "Virtual", etc. I guess the actual creators of
                        those abominations regret them now, but then, again, shite happens.

                        b) Generics. This is really great, and -- having some experience with
                        C++ -- something that I really missed. All that copy pasted code in
                        collection classes, argh... When VB.Net addopted generics, I knew it
                        would be hard not to try the language.

                        c) Multithreading. Not having to use DoEvents, PeekMessage and company
                        to keep the impression that the UI is alive while a lengthy operation
                        is going on -- and most of the things I must accomplish with coding are
                        lengthy opperations -- boy, that is liberating...

                        d) Delegates. Even though I allways preffered VB, I didn't refrain from
                        activelly using other languages -- mostly Delphi (because -- Turbo --
                        Pascal was my second language), and C++. The possibility allowed by
                        function pointers that these languages provided was something the VB
                        programmer in me allways envied. Not anymore. =))

                        Yes, there are inconsistencies in VB.Net that make me shiver whenever I
                        stumble on them -- and they're all over the place -- but I still prefer
                        this mutant -- and more powerfull -- language than any of the
                        alternatives presented so far: Delphi.Net, C#, managed C++, J#, Java,
                        IronPython, Ruby, PHP.Net, Boo, F# (m.f.g., when the "#" trend will
                        end?)
                        I would rather use PHP.
                        <snip>
                        I *use* PHP, thank you. wamp really rocks. But notice that I started
                        using PHP for web apps much before .Net and AspX. The out-of-the-box
                        experience of creating an ASP site doesn't come near to what
                        Dreamweaver + PHP + MySQL + Apache provide. Notice also that I still
                        didn't -- nor am intending to -- try AspX. But if the necessity
                        arrives, who knows?

                        Regards, and have fun.

                        Branco.

                        Comment

                        • aaron.kempf@gmail.com

                          #13
                          Re: FSO equivalent in VB.net

                          Branco;

                          I fully agree about ASPX: it's nice to see we agree on something :)

                          btw; WAMP? vs LAMP? Is WAMP really a good solution?

                          is there anyone that offers a virtual server image preconfigured for
                          WAMP and it also included PhpMyAdmin for example?

                          so you don't like the idea of VB 2007 getting named B#?
                          I think that we should put somehting on MSDN and we should all _VOTE_
                          on it.

                          Anyone know how to do that? I don't want to do it under my name;
                          they'll just block it :)

                          -Aaron



                          Branco Medeiros wrote:
                          aaron.kempf@gma il.com wrote (inline):
                          VB.net has no benefit of VB6.
                          >
                          It allows me to program .Net in a case insensitive language that
                          doesn't use "{" "}" as block delimeters or ";" as statement terminator.
                          =)
                          >
                          <snip>
                          VB 2005 won me over also-- for a couple of months.

                          when I realized that I couldnt' deliver projects in the same ballpark
                          as VB6; i fell off the wagon.

                          yes; it has some nice features.
                          but I don't see any compelling reason to buy into MS .Net strategy.
                          The only benefit is that you're tied to Windows.
                          >
                          *I am* tied to Windows, all right -- at least here, at my job. VB.Net
                          is clumsy, the compiler is slow, edit n' continue is ridiculous
                          (compared to what VB.classic provided), but, on the other side, I have:
                          >
                          a) A powerfull object oriented language. Inheritance rulez, I'd say, if
                          I was not this old. This alone would have been a reason to migrate to
                          VB.Net if it wasn't for the childish approach to naming the related
                          keywords... I hate the "MustInheri t", "NotInheritable ", etc
                          mambo-jambo. I'd really prefer the "official" terms, such as
                          "Abstract", "Final", "Virtual", etc. I guess the actual creators of
                          those abominations regret them now, but then, again, shite happens.
                          >
                          b) Generics. This is really great, and -- having some experience with
                          C++ -- something that I really missed. All that copy pasted code in
                          collection classes, argh... When VB.Net addopted generics, I knew it
                          would be hard not to try the language.
                          >
                          c) Multithreading. Not having to use DoEvents, PeekMessage and company
                          to keep the impression that the UI is alive while a lengthy operation
                          is going on -- and most of the things I must accomplish with coding are
                          lengthy opperations -- boy, that is liberating...
                          >
                          d) Delegates. Even though I allways preffered VB, I didn't refrain from
                          activelly using other languages -- mostly Delphi (because -- Turbo --
                          Pascal was my second language), and C++. The possibility allowed by
                          function pointers that these languages provided was something the VB
                          programmer in me allways envied. Not anymore. =))
                          >
                          Yes, there are inconsistencies in VB.Net that make me shiver whenever I
                          stumble on them -- and they're all over the place -- but I still prefer
                          this mutant -- and more powerfull -- language than any of the
                          alternatives presented so far: Delphi.Net, C#, managed C++, J#, Java,
                          IronPython, Ruby, PHP.Net, Boo, F# (m.f.g., when the "#" trend will
                          end?)
                          >
                          I would rather use PHP.
                          <snip>
                          I *use* PHP, thank you. wamp really rocks. But notice that I started
                          using PHP for web apps much before .Net and AspX. The out-of-the-box
                          experience of creating an ASP site doesn't come near to what
                          Dreamweaver + PHP + MySQL + Apache provide. Notice also that I still
                          didn't -- nor am intending to -- try AspX. But if the necessity
                          arrives, who knows?
                          >
                          Regards, and have fun.
                          >
                          Branco.

                          Comment

                          • Branco Medeiros

                            #14
                            Re: FSO equivalent in VB.net


                            aaron.kempf@gma il.com wrote:
                            btw; WAMP? vs LAMP? Is WAMP really a good solution?
                            I meant, wamp for in-house development (Windows machines, here). After
                            that, lamp, of course.

                            Regards,

                            Branco.

                            Comment

                            Working...