Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to rename a file in VB.NET

Status
Not open for further replies.

metal

Full Member level 6
Full Member level 6
Joined
Dec 21, 2004
Messages
364
Helped
19
Reputation
38
Reaction score
6
Trophy points
1,298
Activity points
3,834
vb.net rename file

Hi

I was writing a small peice of code in order to be able to change the file name from within my software. Any one has idea of how I can do that.

Thanks in advance :)
 

Zhasha

Junior Member level 3
Junior Member level 3
Joined
Dec 3, 2005
Messages
30
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
Denmark
Activity points
1,643
from VB6 i remember a command called Name, im not sure as to whether it will work in VB.NET but its worth a try
 

metal

Full Member level 6
Full Member level 6
Joined
Dec 21, 2004
Messages
364
Helped
19
Reputation
38
Reaction score
6
Trophy points
1,298
Activity points
3,834
Hi

My friend, there is no RENAME method in VB.NET, thats why I was asking on how to make it.....
 

VSMVDD

Banned
Advanced Member level 2
Joined
Jun 12, 2005
Messages
643
Helped
92
Reputation
184
Reaction score
34
Trophy points
1,308
Location
scotland uk
Activity points
0
man be more specific what file name are you on about ? your applications exe etc... wtf name do you mean
???

ps happy new year...!!!

:|
 

metal

Full Member level 6
Full Member level 6
Joined
Dec 21, 2004
Messages
364
Helped
19
Reputation
38
Reaction score
6
Trophy points
1,298
Activity points
3,834
Hi

I need to specify a file from the open dialog, then I get its name, after that I want to process the file name, for example, use ToUpper method to make all letters capital, after that rename the same file with the new processed string.

Thanks
 

metal

Full Member level 6
Full Member level 6
Joined
Dec 21, 2004
Messages
364
Helped
19
Reputation
38
Reaction score
6
Trophy points
1,298
Activity points
3,834
Hi

I just need to know how rename a file in VB.NET,thats all. For a practiced programmer, its too easy to answer.

Thanks
 

hoangkhoi

Newbie level 5
Newbie level 5
Joined
Nov 24, 2005
Messages
10
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,416
VB.NET source code showing how to move or rename a file.
' How to move / rename a file.
Private Sub button6_Click(sender As Object, e As System.EventArgs)

Dim fi As New FileInfo("myImage.gif")

fi.MoveTo("myImage2.gif")

End Sub 'button6_Click
 

metal

Full Member level 6
Full Member level 6
Joined
Dec 21, 2004
Messages
364
Helped
19
Reputation
38
Reaction score
6
Trophy points
1,298
Activity points
3,834
Hi

Thanks alot. I have already solved that problem.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top