1.创建相应的文件夹
/// <summary> /// 按名字创建相应的文件夹 /// </summary> /// <param name="dirName"></param> /// <returns></returns> private string CreatePdfPath(string dirName) { string dirpath = System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase + @"......TemporaryFiles"; dirpath = @dirpath + @dirName + @""; if (!Directory.Exists(dirpath)) Directory.CreateDirectory(dirpath); return @dirpath; }
2.删除临时文件
/// <summary> /// 删除临时文件 /// </summary> /// <param name="filePath"></param> private void DelSourceFiles(string filePath) { System.IO.File.Delete(filePath); }