好的,所以我和其他幾個人正試圖從遊戲啓動器移動一堆文件。到你選擇的目錄。將文件夾從一個目錄移動到另一個目錄。在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