【发布时间】:2012-05-16 07:34:42
【问题描述】:
我正在尝试使用它来复制文件 -
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% 更改为我的实际用户名,否则它将无法正常工作,我该如何解决这个问题?
【问题讨论】:
标签: c# copy profile user-profile