Solved

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

Posted on 2010-08-27
5
1,037 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
Comment Utility
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
Comment Utility
0
 
LVL 16

Expert Comment

by:13598
Comment Utility
0
 
LVL 16

Accepted Solution

by:
13598 earned 500 total points
Comment Utility
0
 

Author Closing Comment

by:BruceHSanford
Comment Utility
Thank You Expert!
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now