//產生一個Log文件夾string appPath = Application.StartupPath; if (!Directory.Exists(appPath + "/log")) { Directory.CreateDirectory(appPath + "/log"); }