C# 复制文件/目录被视为病毒更新应用程序

C# 复制文件/目录被视为病毒更新应用程序,c#,.net,copy,auto-update,virus,C#,.net,Copy,Auto Update,Virus,卡巴斯基将我程序中的以下代码视为病毒 有解决这个问题的建议吗 我正在做的是更新应用程序。我创建一个临时文件夹,下载其中的文件,然后删除原始文件夹中的文件,最后将文件从临时文件夹复制到原始文件夹中。这最后一步被卡巴斯基当作病毒对待 private void CopiarPasta(string origem, string destino) { //copy the directories foreach (string dirPath in System.

卡巴斯基将我程序中的以下代码视为病毒

有解决这个问题的建议吗

我正在做的是更新应用程序。我创建一个临时文件夹,下载其中的文件,然后删除原始文件夹中的文件,最后将文件从临时文件夹复制到原始文件夹中。这最后一步被卡巴斯基当作病毒对待

private void CopiarPasta(string origem, string destino)
    {
        //copy the directories
        foreach (string dirPath in System.IO.Directory.GetDirectories(origem, "*", System.IO.SearchOption.AllDirectories))
        {
            System.IO.Directory.CreateDirectory(dirPath.Replace(origem, destino));
        }

        //copy the files
        foreach (string newPath in System.IO.Directory.GetFiles(origem, "*.*", System.IO.SearchOption.AllDirectories))
        {
            try
            {
                System.IO.File.Copy(newPath, newPath.Replace(origem, destino));
            }
            //I can't kill vshost32.exe
            catch { }
        }
    }

每当你说“抓”{}的时候,你可能是在自作主张。我同意,但我认为这现在并不重要。您是否尝试过最后一步,将参数设置为true File.CopynewPath,newPath.Replaceorigem,destino,true而不是删除和复制?@SriramSakthivel,我刚刚尝试过,但问题仍然存在。我可以问一下,你是如何得出结论的,这段代码对卡巴斯基来说是有问题的?