大家帮忙看看:
string[] img=Directory.GetFiles(System.Windows.Forms.Application.StartupPath+"\\..\\..\\Image","*.JPG");
for(int i=0;i<img.Length;i++)
{
proc=new Process();
proc.StartInfo.FileName="C:\\Program Files\\WinRAR\\Rar.exe";
proc.StartInfo.Arguments="a "+System.Windows.Forms.Application.StartupPath+"\\..\\..\\Image\\"+System.IO.Path.GetFileNameWithoutExtension(img[i].ToString())+".rar"+" "+System.Windows.Forms.Application.StartupPath+"\\..\\..\\Image\\"+System.IO.Path.GetFileName(img[i].ToString())+""+"";
proc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
proc.Start();
proc.WaitForExit();
}
为什么压缩后,图片在每个压缩文件下的image文件夹下,
string[] img=Directory.GetFiles(System.Windows.Forms.Application.StartupPath+"\\..\\..\\Image","*.JPG");
for(int i=0;i<img.Length;i++)
{
proc=new Process();
proc.StartInfo.FileName="C:\\Program Files\\WinRAR\\Rar.exe";
proc.StartInfo.Arguments="a "+System.Windows.Forms.Application.StartupPath+"\\..\\..\\Image\\"+System.IO.Path.GetFileNameWithoutExtension(img[i].ToString())+".rar"+" "+System.Windows.Forms.Application.StartupPath+"\\..\\..\\Image\\"+System.IO.Path.GetFileName(img[i].ToString())+""+"";
proc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
proc.Start();
proc.WaitForExit();
}
为什么压缩后,图片在每个压缩文件下的image文件夹下,
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货