본문 바로가기
프로그래밍/C#

[C#] 파일이름 변경하기

by JR2 2021. 3. 16.

 

infodbbase.tistory.com/118

www.delftstack.com/ko/howto/csharp/how-to-rename-a-file-in-csharp/

using System.IO;


private void button1_Click(object sender, EventArgs e)
{
	string oldFile = null;
	string newFile = null;
	string filePath = null;

	oldFile = filePath + "\\" + oldFile;
	newFile = filePath + "\\" + newFile;

	System.IO.File.Move(oldFile, newFile);

	MessageBox.Show("Change!");
}

 

댓글