📜  如何更改文件的扩展名 C# 代码示例

📅  最后修改于: 2022-03-11 14:49:17.897000             🧑  作者: Mango

代码示例1
//There is: Path.ChangeExtension method. E.g.:
var result = Path.ChangeExtension(myffile, ".jpg");

//In the case if you also want to physically change the extension, you could use File.Move method:
File.Move(myffile, Path.ChangeExtension(myffile, ".jpg"));