C# 呼叫執行 WinRar

using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;
using System.IO;

namespace BatchRar {
class Program {
static void Main(string[] args) {
String path = “d:\cvs\”;
DirectoryInfo di = new DirectoryInfo( path);
foreach (DirectoryInfo d in di.GetDirectories()) {
//WinRAR.exe a -r -m0 -v1G c:\bak.rar c:\dat\
                String cmd = String.Format(” a “{1}{2}.rar” “{0}””, d.FullName, path, d.Name);
                Process proc = new Process();
proc.StartInfo = new ProcessStartInfo(“winrar.exe“, cmd);
proc.Start();
proc.WaitForExit();

}

}
}
}

by mhchen15 on 16 1 月, 2016 in Visual C# - Tags:
Tags:

There are no comments.

Name*: Website: E-Mail*:
XHTML: You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>