Hey there,
Try this to get TESTAPP:
string dirpath = @"" + dir;
String ss = String.Empty;
ss = dir.Substring(dir.LastIndexOf("\\") + 1);
string compressedDirpath = @"" + dir + "\\" + ss + ".gz";
string[] argd = { dirpath, compressedDirpath };
I do not understand why you were doing
dir.Remove(i)
, but it was causing the problem.
Hope it helps.
Azee...