好的,所以我和其他几个人正试图从游戏启动器移动一堆文件。到你选择的目录。将文件夹从一个目录移动到另一个目录。在c#
问题是,文件不会移动。
发射器的工作方式是,您在游戏中单击安装,它将安装一堆文件到您选择的位置。但文件不会移动。
这里的代码。
private void MoveFolders()
{
string sourceDir = Config.GetGamePath();
string destinationDir = textBoxFolder.Text;
try
{
if (Directory.Exists(sourceDir) == true)
{
if (bGameIsInstalled == true && textBoxFolder.TextLength > 0)
{
Directory.Move(sourceDir, destinationDir);
bMoveFolders = true;
}
else
{
MessageBox.Show("Select Arma 3 directory before starting game");
}
}
else
{
// Do somthing about source directory not existing -
}
}
catch (Exception ex)
{
//TODO: Handle the execption that has been thrown will do this on launcher update
}
}
也许会抛出一些异常? – 2015-04-01 06:49:27
我们不会调试您的代码,当您完成该操作后,您会发现源/目标字符串不是您想要的。或者它会抛出一个错误(权限?),我们可以从那里去。 – Mathemats 2015-04-01 06:51:21
你能否提供'sourceDir'和'destinationDir'的样本(它们是否有相同的音量/盘符)? – 2015-04-01 06:51:30