00tree00
00tree00
CC#
Created by 00tree00 on 2/18/2023 in #help
Delete only specific files
Hi everyone I would like the application to delete only the files that are in the array, I tried to do it this way but unfortunately it doesn't delete the files, maybe someone knows how to fix this?
string[] gamePaths = Directory.GetFiles(rootPath);


foreach (string gamePathss in gamePaths)
{
var name = new FileInfo(gamePathss).Name;
name = name.ToLower();
if (name == "d3dcompiler_43.dll" & name == "d3dx9_43.dll" & name == "glew32.dll" & name == "init.lua" & name == "libcrypto.dll" & name == "libcrypto-1_1.dll" & name == "libcurl.dll" & name == "libEGL.dll" & name == "libgcc_s_dw2-1.dll" & name == "libGLESv2.dll" & name == "libluajit.a" & name == "libssl-1_1.dll" & name == "libstdc++-6.dll" & name == "libwinpthread-1.dll" & name == "openal32.dll" & name == "otclientrc.dll" & name == "zlib.dll")
{
File.Delete(gamePathss);
}
}
string[] gamePaths = Directory.GetFiles(rootPath);


foreach (string gamePathss in gamePaths)
{
var name = new FileInfo(gamePathss).Name;
name = name.ToLower();
if (name == "d3dcompiler_43.dll" & name == "d3dx9_43.dll" & name == "glew32.dll" & name == "init.lua" & name == "libcrypto.dll" & name == "libcrypto-1_1.dll" & name == "libcurl.dll" & name == "libEGL.dll" & name == "libgcc_s_dw2-1.dll" & name == "libGLESv2.dll" & name == "libluajit.a" & name == "libssl-1_1.dll" & name == "libstdc++-6.dll" & name == "libwinpthread-1.dll" & name == "openal32.dll" & name == "otclientrc.dll" & name == "zlib.dll")
{
File.Delete(gamePathss);
}
}
5 replies
CC#
Created by 00tree00 on 2/8/2023 in #help
Unable to cast object of type - tried to explicit conversion operator
5 replies