FileSystemObject 2005 Equivalent

dgorka

Well-known member
Joined
Dec 27, 2006
Messages
88
Programming Experience
5-10
I was wondering if anyone knew what the VB.NET 2005 Equivalent is for the VB6 FileSystemObject class. I've been looking online but am not finding anything that really fits what i need. I need to be able to use it to set the name of a file. i.e.
File.Name = strTiffFileRename
I've tried using the FileStream class but Name is a Get only function for that class.

Thanks in advance!
 
Both the My.Computer.FileSystem and System.IO.File objects can be used, I would suggest the former.
VB.NET:
' Change "c:\test.txt" to the path and filename for the file that
' you want to rename.
My.Computer.FileSystem.RenameFile("C:\Test.txt", "SecondTest.txt")
This is from MSDN, How to: Rename a File in Visual Basic.
There is also this article on How to: Insert Snippets Into Your Code. The snippets installed with VS contain common code blocks.
 
Back
Top