السلام عليكم ورحمة الله وبركاته
كيف الحال
هذا الكود يقوم بضغط المجلادات ولا هناك مشكله عند فتح الملف يكون داخلة المسار الكامل للخامد او مسار المجلدات الاصلية من الخادم وانا اريد الملف فقط في الداخل مثال
c:\asf\iugkj\knjh
يكون الناتج بداخل الملف المضغوط
knjh ولي asf\iugkj\knjh
private void subZip(string sSourceDir, string sDestinationDir, string sRarFileName)
{
RegistryKey the_Reg = Registry.ClassesRoot.OpenSubKey("Applications\\WinRAR.exe\\Shell\\Open\\Command");
object the_Obj = the_Reg.GetValue("");
string the_rar= the_Obj.ToString();
string the_Info;
ProcessStartInfo the_StartInfo;
Process the_Process;
the_Reg.Close();
the_rar = the_rar.Substring(1, the_rar.Length - 7);
the_Info = " a " + sRarFileName + " " + sSourceDir;
the_StartInfo = new ProcessStartInfo();
the_StartInfo.FileName = the_rar;
the_StartInfo.Arguments = the_Info;
the_StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
the_StartInfo.WorkingDirectory = sDestinationDir;
the_Process = new Process();
the_Process.StartInfo = the_StartInfo;
the_Process.Start();
}ثانيا ائقاف البرنامج لحظات حتي يتم الانتهام من ما سبق لانه ياخذ لخظات بعد انتهاء الكود السابق