❔ cant delete folders from appdata local and roaming
public static void UbisoftCache()
{
string appDataLocal = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
string appDataRoaming = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
string digitalEntitlementsPath = Path.Combine(appDataLocal, "DigitalEntitlements");
string citizenFXPath = Path.Combine(appDataRoaming, "CitizenFX");
try
{
// Usuń folder DigitalEntitlements, jeśli istnieje
if (Directory.Exists(digitalEntitlementsPath))
{
Directory.Delete(digitalEntitlementsPath, true);
}
// Usuń folder CitizenFX, jeśli istnieje
if (Directory.Exists(citizenFXPath))
{
Directory.Delete(citizenFXPath, true);
}
}
catch (Exception ex)
{
// Obsłuż wyjątki, jeśli wystąpiły
Console.WriteLine("Wystąpił błąd podczas usuwania folderów: " + ex.Message);
}
}
4 Replies
generally i don't know how to remove the folder from appdaty local and roaming i tried everything but it doesn't work
Most likely a permission issue.
They could also be used by another process, locked.
Add ex.StackTrace to the catch block.
thannks
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.