Advertisement

06.23.2008 at 05:13PM PDT, ID: 23509545
[x]
Attachment Details

Convert VB to C#, Scripting.FileSystemObject becomes what..?

Asked by FrancineTaylor in Microsoft Visual C#.Net, Microsoft Visual Basic.Net

Tags: Microsoft, Visual Studio, 2005

I have a very simple VB.NET (I assume it's .NET, may be old style VB) application that I am trying to convert to C#

Here is the problem code:

Dim fso As New Scripting.FileSystemObject
Dim fdr As Folder
Dim fil As File

fdr = fso.GetFolder(path)

For Each fil In fdr.Files
   do stuff
Next

I'm assuming the Folder is translated to an object of type System.IO.Directory, and File is System.IO.File, but I couldn't find an equivalent for the FileSystemObject.

What would the other functionality translate to?
Start Free Trial
 
Loading Advertisement...
 
[+][-]06.23.2008 at 05:23PM PDT, ID: 21851558

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.23.2008 at 05:24PM PDT, ID: 21851566

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.23.2008 at 05:25PM PDT, ID: 21851570

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Visual C#.Net, Microsoft Visual Basic.Net
Tags: Microsoft, Visual Studio, 2005
Sign Up Now!
Solution Provided By: purplepomegranite
Participating Experts: 2
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628