Solved

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

Posted on 2010-08-27
5
1,183 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

751 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