我使用下面的代码将我的文件夹复制到启动文件夹中,它正确地复制exe文件而不是文件夹并简单地显示一个未扩展文件,而exe被正确复制
string startupFolder = Environment.GetFolderPath(Environment.SpecialFolder.Startup);
if (Directory.GetCurrentDirectory() != startupFolder)
{
string ownPath = Assembly.GetExecutingAssembly().Location;
File.Copy(ownPath, Path.Combine(startupFolder, "player.exe"));
File.Copy(ownPath, Path.Combine(startupFolder, "player_Data"));
}
player_Data是要复制的文件夹名称