我正在尝试使用此复制文件-
private void button1_Click(object sender, EventArgs e)
{
Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
if (File.Exists(@"C:\Users\%UserProfile%\AppData\Roaming\.minecraft\bin\minecraft.jar"))
try
{
File.Copy(@"C:\Users\%UserProfile%\AppData\Roaming\.minecraft\bin\minecraft.jar", @"C:\Users\%UserProfile%\Documents\MinecraftBackup\minecraft.jar", true);
}
除非我将 %UserProfile% 更改为我的实际用户名,否则它将无法工作,我该如何解决这个问题?