Tengo un problema y creería que es algo muy tonto, pero llevo ya unos días buscando y probando, pero no me ha funcionado bien
Tengo un programa que al ejecutarse debe eliminar la carpeta de Flash player para que otra aplicación en Flash vuelva a cargar los archivos, el proceso parece que funciona, pero la carpeta no se elimina a pesar de que la barra de progreso de borrado si se ejecuta en pantalla... Tengo que dejarles el código para que sea un poco mas entendible y se pueda revisar.
Soy muy nuevo en C#, así que realmente estoy un poco perdido.
Process processById = Process.GetProcessById(Interaction.Shell("RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8", AppWinStyle.MinimizedFocus, false, -1));
while (!processById.HasExited)
{
if (!processById.HasExited)
{
continue;
}
goto Label0;
}
}
catch (Exception exception)
{
ProjectData.SetProjectError(exception);
ProjectData.ClearProjectError();
}
Label0:
string str = string.Concat(Environment.GetEnvironmentVariable("%appdata%\\Macromedia\\Flash Player"));
if (MyProject.Computer.FileSystem.DirectoryExists(str))
{
try
{
enumerator = MyProject.Computer.FileSystem.GetDirectories(str).GetEnumerator();
while (enumerator.MoveNext())
{
string str1 = string.Concat(enumerator.Current, "\\localhost");
if (!MyProject.Computer.FileSystem.DirectoryExists(str1))
{
continue;
}
using (enumerator1)
{
enumerator1 = MyProject.Computer.FileSystem.GetDirectories(str1).GetEnumerator();
while (enumerator1.MoveNext())
{
string current = enumerator1.Current;
nameOfPath = new string[] { current, "\\", this.GetName_OfPath(Environment.CurrentDirectory), "\\", this.loaderFolderName };
string str2 = string.Concat(nameOfPath);
if (!MyProject.Computer.FileSystem.DirectoryExists(str2))
{
continue;
}
using (enumerator2)
{
enumerator2 = MyProject.Computer.FileSystem.GetFiles(str2).GetEnumerator();
while (enumerator2.MoveNext())
{
string current1 = enumerator2.Current;
string nameOfPath1 = this.GetName_OfPath(current1);
if (!((nameOfPath1.Contains(this.ConstantAKCache) | nameOfPath1.Contains(this.ConstantAKLang)) & nameOfPath1.Contains(this.ExtCacheFiles)))
{
continue;
}
File.Delete(current1);
}
}
}
}
}
}
finally
{
if (enumerator != null)
{
enumerator.Dispose();
}
}
}
str = string.Concat(Environment.GetEnvironmentVariable("ProgramData\\Macromedia\\Flash Player"));
if (MyProject.Computer.FileSystem.DirectoryExists(str))
{
try
{
enumerator3 = MyProject.Computer.FileSystem.GetDirectories(str).GetEnumerator();
while (enumerator3.MoveNext())
{
string str3 = string.Concat(enumerator3.Current, "\\localhost");
if (!MyProject.Computer.FileSystem.DirectoryExists(str3))
{
continue;
}
using (enumerator4)
{
enumerator4 = MyProject.Computer.FileSystem.GetDirectories(str3).GetEnumerator();
while (enumerator4.MoveNext())
{
string current2 = enumerator4.Current;
nameOfPath = new string[] { current2, "\\", this.GetName_OfPath(Environment.CurrentDirectory), "\\", this.loaderFolderName };
string str4 = string.Concat(nameOfPath);
if (!MyProject.Computer.FileSystem.DirectoryExists(str4))
{
continue;
}
using (enumerator5)
{
enumerator5 = MyProject.Computer.FileSystem.GetFiles(str4).GetEnumerator();
while (enumerator5.MoveNext())
{
string current3 = enumerator5.Current;
string nameOfPath2 = this.GetName_OfPath(current3);
if (!((nameOfPath2.Contains(this.ConstantAKCache) | nameOfPath2.Contains(this.ConstantAKLang)) & nameOfPath2.Contains(this.ExtCacheFiles)))
{
continue;
}
File.Delete(current3);
}
}
}
}
}
}
finally
{
if (enumerator3 != null)
{
enumerator3.Dispose();
}
}
}
Gracias de antemano!