Solved

What is .Net substitute for Scripting.FileSystemObject's GetFile function?

Posted on 2010-08-27
5
1,132 Views
Last Modified: 2013-11-27
I'm migrating from VB6 to VB 2010 .Net and having a problem with what to do with my old Scripting.FileSystemObject functions.

Below is some VB6 code. What namespace do I need to use and specifically how would  do thisI:
Dim fs As New Scripting.FileSystemObject
Dim FileCurrent as File
Set fileCurrent = fs.GetFile(App.Path & "\SomeFile.exe")
0
Comment
Question by:BruceHSanford
5 Comments
 
LVL 17

Expert Comment

by:Zhaolai
ID: 33546010
The closet one is FileInfo, like this:

        Dim oInfo As System.IO.FileInfo = My.Computer.FileSystem.GetFileInfo(My.Application.Info.DirectoryPath & "\SomeFile.exe")

0
 
LVL 18

Expert Comment

by:Anil Golamari
ID: 33546048
0
 
LVL 16

Expert Comment

by:13598
ID: 33546303
0
 
LVL 16

Accepted Solution

by:
13598 earned 500 total points
ID: 33546318
0
 

Author Closing Comment

by:BruceHSanford
ID: 33558677
Thank You Expert!
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SSRS 2016 Rendering HTML tables 3 25
VS 2017 18 30
SSIS Start 2 20
C# class library debugging - Breakpoint will not hit. 8 16
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question