private void BillingForm_FormClosing(object sender, FormClosingEventArgs e) { // daily sale report generated by dafault if staff by mistake closes the application. DailySalesReportButton_Click(sender, e); DialogResult Message = MessageBox.Show("do yo want to Update the stock ?", "Confiramtion Message", MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (Message == DialogResult.Yes) { //Code to save the daily transactions everyday. File.Delete("StockFile.txt"); StreamWriter FileWrite; FileWrite = File.AppendText("StockFile.txt"); for (int i = 0; i < 14; i++) { for (int j = 0; j < 5; j++) { FileWrite.WriteLine(StockArray[i, j].ToString()); } } FileWrite.Close(); } else { e.Cancel = true; ExitButton.Focus(); } }
static void Main(string[] args) { string fpath = args[0]; var fr = new FileRead(); fr.ReadGed(fpath); string opath = Path.ChangeExtension(fpath, "ged_out"); FileWrite.WriteGED(fr.Data, opath); //string apath = @"E:\TestGeds"; //string apath = @"Z:\HOST_E\projects\GED\GED files\Ged too big\2524482.ged"; //Console.WriteLine(apath); //dump(fr.Data); //var files = Directory.GetFiles(apath, "*.ged"); //foreach (var afile in files) //{ // Console.WriteLine(afile); // var fr = new FileRead(); // fr.ReadGed(afile); // dump(fr.Data); //} }
public static string Write(FileRead fr, bool noHead = true, bool unix = true) { MemoryStream mem = new MemoryStream(); FileWrite.WriteRecs(mem, fr.Data, noHead, unix); return(Encoding.UTF8.GetString(mem.ToArray(), 0, (int)mem.Length)); }
public void gpsdata(int dbsk, int dbgsk) { //declaration of varibles //int i = ; int sk = dbsk; int gsk = dbgsk; string gstr1; //declaration of class object FileRead rd = new FileRead(); FilegRead grd = new FilegRead(); FileWrite wr = new FileWrite(); GPStringFromating gdata = new GPStringFromating(); //code to setup gps string updates rd.ReadData(sk); //sk = sk + 69; //reading strings and processing them gstr1 = grd.ReadgData(gsk); Console.WriteLine(gstr1); //gsk = gsk + 69; gdata.Gpsplit(gstr1); //creating a wait at output Console.ReadLine(); }
} // proc ProcessRecord private void CreateZipStream(DirectoryInfo targetPath, string zipArchiveName, out FileWrite zipStream, out ZipOutputStream zip) { zipStream = new FileWrite(Notify, new FileInfo(Path.Combine(targetPath.FullName, zipArchiveName)), true, CompressMode.Stored); zip = new ZipOutputStream(zipStream.Stream); zip.UseZip64 = UseZip64.On; zip.SetLevel(5); } // proc CreateZipStream
} // proc ZipFileItem private void GZipFileItem(CmdletNotify notify, CmdletProgress bar, Stream src, DirectoryInfo targetPath, FileIndexItem item) { using (var dst = new FileWrite(notify, new FileInfo(Path.Combine(targetPath.FullName, item.ArchiveName)), false, CompressMode.Auto)) { Stuff.CopyRawBytes(bar, item.RelativePath, src.Length, src, dst.Stream); dst.Commit(); } } // proc GZipFileItem
public FileLoggerProcess(string fileName) { fileWrite = new FileWrite(fileName); _outputThread = new Thread(ProcessLogQueue) { IsBackground = true, Name = "File logger queue processing thread" }; _outputThread.Start(); }
public override bool Download() { CurrentParameter.IsStop = false; //排版插件 var typeSetting = new Collection <ITypeSetting> { new BrRegex(), new HtmlDecode(), new UniformFormat(), new Traditional() }; for (; TaskInfo.BeginSection <= TaskInfo.EndSection && !CurrentParameter.IsStop; TaskInfo.BeginSection++) { string url = string.Format("http://www.ranwen.net/files/article/{0}/{1}/{2}.html", (CommonTools.TryParse(TaskInfo.Tid, 0) / 1000).ToString(CultureInfo.InvariantCulture), TaskInfo.Tid, SectionNames[TaskInfo.CurrentSection].ToString(CultureInfo.InvariantCulture));//組合網址 HtmlDocument htmlRoot = GetHtmlDocument(url); try { string tempTextFile = htmlRoot.DocumentNode.SelectSingleNode("//*[@id=\"bgdiv\"]/table[2]/tbody/tr[1]/td/div[1]/h1").InnerText + "\r\n"; var node = htmlRoot.DocumentNode.SelectSingleNode("//*[@id=\"content\"]"); Network.RemoveSubHtmlNode(node, "div"); tempTextFile += node.InnerHtml + "\r\n"; foreach (var item in typeSetting) { item.Set(ref tempTextFile); } FileWrite.TxtWrire(tempTextFile, TaskInfo.SaveFullPath, TaskInfo.TextEncoding); } catch (Exception) { //CoreManager.LoggingManager.Debug(ex.ToString()); //發生錯誤,當前區塊重取 TaskInfo.BeginSection--; TaskInfo.FailTimes++; continue; } TaskInfo.HasStopped = CurrentParameter.IsStop; } bool finish = TaskInfo.CurrentSection == TaskInfo.EndSection; return(finish); }
public override bool Download() { CurrentParameter.IsStop = false; string urlHead = string.Format("http://book.sfacg.com/Novel/{0}", TaskInfo.Tid); //string urlTail = ".html?charset=big5"; //排版插件 var typeSetting = new Collection <ITypeSetting> { new SfacgToIndent(), new HtmlDecode(), new UniformFormat(), new Traditional() }; for (; TaskInfo.BeginSection <= TaskInfo.EndSection && !CurrentParameter.IsStop; TaskInfo.BeginSection++) { string url = urlHead + SectionNames[TaskInfo.CurrentSection].ToString(CultureInfo.InvariantCulture);//組合網址 HtmlDocument htmlRoot = GetHtmlDocument(url); try { var nodeHeaders = htmlRoot.DocumentNode.SelectSingleNode(@"//*[@id=""ChapterBody""]"); Network.RemoveSubHtmlNode(nodeHeaders, "img"); string tempTextFile = nodeHeaders.InnerHtml; foreach (var item in typeSetting) { item.Set(ref tempTextFile); } FileWrite.TxtWrire(tempTextFile, TaskInfo.SaveFullPath, TaskInfo.TextEncoding); } catch (Exception) { //CoreManager.LoggingManager.Debug(ex.ToString()); //發生錯誤,當前區塊重取 TaskInfo.BeginSection--; TaskInfo.FailTimes++; continue; } TaskInfo.HasStopped = CurrentParameter.IsStop; } bool finish = TaskInfo.CurrentSection == TaskInfo.EndSection; return(finish); }
public static FileWrite GetFileWriteReport(DebuggerThread Context, uint[] Data) { FileWrite Report = new FileWrite(); Report.Handle = new IntPtr(Data[0]); Report.Length = Data[1]; Report.Offset = Data[2]; return(Report); }
public static FileWrite GetFileWriteReport(DebuggerThread Context, DataProcessor Data) { FileWrite Report = new FileWrite(); Report.Handle = new IntPtr(Data.Pop()); Report.Length = Data.Pop(); Report.Offset = Data.Pop(); return(Report); }
private void ParallelDownLoad(Dictionary <int, string> container, string info, IPlugin lrcDown) { toolStripStatusLabel_Information.Text = info; toolStripProgressBar_DownLoad.Value = 0; toolStripProgressBar_DownLoad.Maximum = container.Count; Parallel.ForEach(container, new ParallelOptions() { MaxDegreeOfParallelism = Config.configValue.option_ThreadNumber }, (item) => { try { FileWrite fs = new FileWrite(); byte[] lrcData = null; if (Config.configValue.option_IgnoreFile && checkMusicExits(item.Value)) { listView_Music.Items[item.Key].SubItems[1].Text = "略过"; } else { // 下载歌词 if (lrcDown.Down(item.Value, ref lrcData, Config.configValue.option_ThreadNumber) == true) { listView_Music.Items[item.Key].SubItems[1].Text = "成功"; if (fs.Write(ref lrcData, item.Value, Config.configValue.option_Encoding, Config.configValue.option_UserDirectory)) { lock (LongLife.MusicPathFailedList) LongLife.MusicPathFailedList.Remove(item.Key); } else { listView_Music.Items[item.Key].SubItems[1].Text = "失败"; } } else { listView_Music.Items[item.Key].SubItems[1].Text = "失败"; lock (LongLife.MusicPathFailedList) { if (!LongLife.MusicPathFailedList.ContainsKey(item.Key)) { LongLife.MusicPathFailedList.Add(item.Key, item.Value); } } } } } catch (Exception exp) { Console.WriteLine(exp.ToString()); } toolStripProgressBar_DownLoad.Value++; }); }
public override bool Download() { CurrentParameter.IsStop = false; string urlHead = "http://lknovel.lightnovel.cn/main/view/"; string urlTail = ".html?charset=big5"; //排版插件 var typeSetting = new Collection <ITypeSetting> { new HtmlDecode(), new UniformFormat() }; for (; TaskInfo.BeginSection <= TaskInfo.EndSection && !CurrentParameter.IsStop; TaskInfo.BeginSection++) { string url = urlHead + SectionNames[TaskInfo.CurrentSection].ToString(CultureInfo.InvariantCulture) + urlTail;//組合網址 HtmlDocument htmlRoot = GetHtmlDocument(url); try { var nodeHeaders = htmlRoot.DocumentNode.SelectSingleNode(@"//*[@id=""J_view""]"); string tempTextFile = nodeHeaders.InnerText; foreach (var item in typeSetting) { item.Set(ref tempTextFile); } FileWrite.TxtWrire(tempTextFile, TaskInfo.SaveFullPath, TaskInfo.TextEncoding); } catch (Exception) { //CoreManager.LoggingManager.Debug(ex.ToString()); //發生錯誤,當前區塊重取 TaskInfo.BeginSection--; TaskInfo.FailTimes++; continue; } TaskInfo.HasStopped = CurrentParameter.IsStop; } bool finish = TaskInfo.CurrentSection == TaskInfo.EndSection; return(finish); }
} // proc CreateZipStream private void CloseZipStream(FileWrite zipStream, ZipOutputStream zip) { if (zip != null) { zip.Flush(); zip.Dispose(); } if (zipStream != null) { zipStream.Dispose(); } } // proc CloseZipStream
/// <summary> /// 写入一行数据 /// </summary> /// <param name="path">路径</param> /// <param name="message">消息</param> public void Write(string path, string message) { if (IsRomte) { RometeWrite(string.Format("{0}|{1}", path, message)); } if (!IsEnable) { return; } FileWrite.Push(path, message); }
private static void InitializeFile(string path, string fileName, string state) { if (FileWrite.WriteStringToFileFalseOnFail(path, state)) { Console.WriteLine(fileName + " Initialized"); } else { Console.WriteLine(fileName + " Failed to Initialize"); } }
public void OnCompleted(FileWrite data) { if (data.Count > 0) { long offset = data.Position + data.Count; long position = completed + data.Count + routine.offset - routine.entries[index].Start; Receiver receiver = new Receiver(routine, index, completed + data.Count); RepositoryViewEntry entry = routine.entries[index]; if (routine.entries.Length > index + 1 && position >= routine.entries[index].Size) { receiver = new Receiver(routine, index + 1, completed + data.Count); entry = routine.entries[index + 1]; position = 0; offset = 0; } if (completed + data.Count == routine.buffer.Count) { routine.callback.Invoke(new RepositoryViewWrite { Piece = routine.piece, Block = routine.block, Buffer = routine.buffer, Count = routine.buffer.Count }); } else { int left = routine.buffer.Count - completed - data.Count; long count = entry.Size - position; if (count > left) { count = left; } entry.File.Write(offset, new FileBuffer(routine.buffer.Data, routine.buffer.Offset + completed + data.Count, (int)count), receiver.OnCompleted); } } else { routine.callback.Invoke(new RepositoryViewWrite { Piece = routine.piece, Block = routine.block, Buffer = routine.buffer, Count = completed }); } }
public override bool Download() { CurrentParameter.IsStop = false; //排版插件 var typeSetting = new Collection <ITypeSetting> { new BrRegex(), new HtmlDecode(), new UniformFormat(), new Traditional() }; for (; TaskInfo.BeginSection <= TaskInfo.EndSection && !CurrentParameter.IsStop; TaskInfo.BeginSection++) { try { string url = string.Format("http://www.biquge.com/{0}/{1}.html", TaskInfo.Tid, SectionNames[TaskInfo.CurrentSection].ToString(CultureInfo.InvariantCulture));//組合網址 HtmlDocument htmlRoot = GetHtmlDocument(url); string tempTextFile = htmlRoot.DocumentNode.SelectSingleNode("//*[@id=\"wrapper\"]/div[3]/div[1]/div[2]/h1").InnerText + "\r\n" + htmlRoot.DocumentNode.SelectSingleNode("//*[@id=\"content\"]").InnerHtml + "\r\n"; foreach (var item in typeSetting) { item.Set(ref tempTextFile); } FileWrite.TxtWrire(tempTextFile, TaskInfo.SaveFullPath, TaskInfo.TextEncoding); } catch (Exception) { //CoreManager.LoggingManager.Debug(ex.ToString()); //發生錯誤,當前區塊重取 TaskInfo.BeginSection--; TaskInfo.FailTimes++; continue; } TaskInfo.HasStopped = CurrentParameter.IsStop; } bool finish = TaskInfo.CurrentSection == TaskInfo.EndSection; return(finish); }
public FileLoggerProcess() { fileWrite = new FileWrite(); _outputThread = new Thread(ProcessLogQueue) { IsBackground = true, Name = "File logger queue processing thread" }; _outputThread.Start(); //ActionBlock 每次处理数据,新开线程,导致性能较差 _messageTPL = new ActionBlock <string>(async(message) => { await WriteMessageAsync1(message, _messageTPL.InputCount == 0); }); }
public Algorithm(ConfigurationModel configuration) : base(1, GetProcessConfiguration()) { _configuration = configuration; _outputFolder = @"Output/"; if (Directory.Exists(_outputFolder) == false) { Directory.CreateDirectory(_outputFolder); } exw = new ExcelWrite(String.Concat(_outputFolder, "stat")); wf = new FileWrite(_outputFolder); }
public override bool Download() { CurrentParameter.IsStop = false; //排版插件 var typeSetting = new Collection <ITypeSetting> { new HtmlDecode(), new UniformFormat(), new HjwzwRegex() }; for (; TaskInfo.BeginSection <= TaskInfo.EndSection && !CurrentParameter.IsStop; TaskInfo.BeginSection++) { try { string url = string.Format("http://tw.hjwzw.com/Book/Read/{0},{1}", TaskInfo.Tid, SectionNames[TaskInfo.CurrentSection].ToString(CultureInfo.InvariantCulture));//組合網址 HtmlDocument htmlRoot = GetHtmlDocument(url); string tempTextFile = htmlRoot.DocumentNode.SelectSingleNode("/html/body/table[7]/tr/td/div[5]").InnerText; foreach (var item in typeSetting) { item.Set(ref tempTextFile); } FileWrite.TxtWrire(tempTextFile, TaskInfo.SaveFullPath, TaskInfo.TextEncoding); } catch (Exception) { //CoreManager.LoggingManager.Debug(ex.ToString()); //發生錯誤,當前區塊重取 TaskInfo.BeginSection--; TaskInfo.FailTimes++; continue; } TaskInfo.HasStopped = CurrentParameter.IsStop; } bool finish = TaskInfo.CurrentSection == TaskInfo.EndSection; return(finish); }
public void Save(List <SectionIni> listSectionIni) { foreach (var item in listSectionIni) { FileWrite.WriteLine($"[{item.Name}]"); FileWrite.Flush(); foreach (var itemA in item.Attribute) { FileWrite.WriteLine($"{itemA.Key}={itemA.Value}"); FileWrite.Flush(); } FileWrite.WriteLine("\n"); FileWrite.Flush(); } }
} // proc ReadIndex public void WriteIndex(CmdletNotify notify, string fileName) { var file = CreateIndexFileName(fileName); // erzeuge den index nicht direkt using (var dst = new FileWrite(notify, file, false, CompressMode.Auto)) using (var sw = new StreamWriter(dst.Stream, Encoding.Unicode)) { var csv = new CsvWriter(sw, FileIndexItem.csvDefinition); foreach (var cur in files.Values) { csv.WriteData(cur.GetLineData()); } dst.Commit(); } } // proc WriteIndex
// 保存为JAVA文件 public static void SaveJavaFile(string str, string name, Encoding encoding) { SaveFileDialog newSaveFile = new SaveFileDialog(); newSaveFile.RestoreDirectory = false; newSaveFile.ValidateNames = true; newSaveFile.DefaultExt = "txt"; newSaveFile.FileName = name + ".java"; newSaveFile.Filter = "java文档(*.java)|*.java|所有文件(*.*)|*.*"; //判断是否点击确定 if (newSaveFile.ShowDialog() == DialogResult.OK) { string path = newSaveFile.FileName; // 调用方法写入文件内容 FileWrite.WriteFile(path, str, encoding); } }
private void SaveToFileButton_Click(object sender, EventArgs e) { //Code to save the daily transactions everyday. File.Delete("StockFile.txt"); StreamWriter FileWrite; FileWrite = File.AppendText("StockFile.txt"); for (int i = 0; i < 14; i++) { for (int j = 0; j < 5; j++) { // MessageBox.Show(StockArray[i, j].ToString()); FileWrite.WriteLine(StockArray[i, j].ToString()); } } FileWrite.Close(); }
public async Task <bool> UninstallModAsync() { var task = new Task <bool>(() => { try { FileWrite.SafeDeleteFile(FileWrite.GetFileOutputPath(Location, RealName, _legacy)); ModsManager.RunOnMainSyncContext(state => ModsManager.InstalledMods.Remove(this)); return(true); } catch (Exception ex) { MessageDisplay.RaiseError(new ErrorEventArgs(ex)); return(false); } }); task.Start(); return(await task); }
public void Save(List <SectionRegistry> sectionRegistries) { foreach (var item in sectionRegistries) { FileWrite.WriteLine($"{Config.Get.SectionStartChar}{item.SectionName}{Config.Get.SectionEndChar}"); FileWrite.Flush(); foreach (var itemA in item.Get()) { if (itemA.Comment != null && itemA.Comment != "") { FileWrite.WriteLine($"{itemA.Key}{Config.Get.KeyValueChar}{itemA.Value} {Config.Get.CommentChar}{itemA.Comment}"); } else { FileWrite.WriteLine($"{itemA.Key}{Config.Get.KeyValueChar}{itemA.Value}"); } FileWrite.Flush(); } FileWrite.WriteLine(""); FileWrite.Flush(); } }
void Start() { if (fileWriter != null) { return; } if (!Application.isEditor) { #if UNITY_ANDROID return; #endif } DontDestroyOnLoad(this); string path = Application.dataPath; path = Path.GetDirectoryName(path); path = path + "/.record"; if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } fileWriter = new TxtFileWriter(path, System.DateTime.Now.ToFileTime() + ".txt"); }
public override bool Download() { CurrentParameter.IsStop = false; Regex r = new Regex(@"(?<Head>^https?:\/\/\w*\.*ck101.com\/thread-\d+-)(?<CurrentPage>\d+)(?<Tail>-\w+\.html)"); Match m = r.Match(TaskInfo.Url); string urlHead = string.Empty, urlTail = string.Empty; if (m.Success) { urlHead = m.Groups["Head"].Value; urlTail = m.Groups["Tail"].Value; } HtmlNodeCollection nodeHeaders = null; int lastPage = 0; //排版插件 var typeSetting = new Collection <ITypeSetting> { new HtmlDecode(), new UniformFormat() }; for (; TaskInfo.BeginSection <= TaskInfo.EndSection && !CurrentParameter.IsStop; TaskInfo.BeginSection++) { //要下載的頁數 try { int newCurrentPage = (TaskInfo.BeginSection + TaskInfo.PageSection - 1) / TaskInfo.PageSection; if (lastPage != newCurrentPage) //之前下載的頁數跟當前要下載的頁數 { lastPage = newCurrentPage; //記錄下載頁數,下次如果一樣就不用重抓 string url = urlHead + lastPage.ToString(CultureInfo.InvariantCulture) + urlTail; //組合網址 if (lastPage == 1) //卡提諾第一頁的特別處理 { switch (TaskInfo.FailTimes % 2) //常常取不到完整資料,用多個網址取 { case 0: url = string.Format("https://ck101.com/thread-{0}-1-1.html", TaskInfo.Tid); break; case 1: url = string.Format("https://m.ck101.com/forum.php?mod=redirect&ptid={0}&authorid=0&postno=1", TaskInfo.Tid); break; case 2: url = string.Format("https://m.ck101.com/forum.php?mod=redirect&ptid={0}&authorid=0&postno=1", TaskInfo.Tid); break; } } HtmlDocument htmlRoot = GetHtmlDocumentReplaceDivToEmpty(url); if (htmlRoot != null) { nodeHeaders = htmlRoot.DocumentNode.SelectNodes("//*[@class=\"t_f\"]"); } } //計算要取的區塊在第幾個 int partSection = TaskInfo.BeginSection - ((lastPage - 1) * TaskInfo.PageSection) - 1; if (nodeHeaders == null) { throw new Exception("下載資料為空的"); } Network.RemoveSubHtmlNode(nodeHeaders[partSection], "div"); Network.RemoveSubHtmlNode(nodeHeaders[partSection], "ignore_js_op"); Network.RemoveSubHtmlNode(nodeHeaders[partSection], "i"); Network.RemoveSubHtmlNode(nodeHeaders[partSection], "script"); string tempTxt = nodeHeaders[partSection].InnerText; foreach (var item in typeSetting) { item.Set(ref tempTxt); } FileWrite.TxtWrire(tempTxt, TaskInfo.SaveFullPath, TaskInfo.TextEncoding); } catch (Exception) { //CoreManager.LoggingManager.Debug(ex.ToString()); //發生錯誤,當前區塊重取 TaskInfo.BeginSection--; TaskInfo.FailTimes++; lastPage = 0; continue; } TaskInfo.HasStopped = CurrentParameter.IsStop; } bool finish = TaskInfo.CurrentSection == TaskInfo.EndSection; return(finish); }
} // proc ProcessRecord private void CreateZipStream(DirectoryInfo targetPath, string zipArchiveName, out FileWrite zipStream, out ZipOutputStream zip) { zipStream = new FileWrite(Notify, new FileInfo(Path.Combine(targetPath.FullName, zipArchiveName)), true, CompressMode.Stored); zip = new ZipOutputStream(zipStream.Stream); zip.UseZip64 = UseZip64.On; zip.SetLevel(5); } // proc CreateZipStream
/*9*/ static int changeDateFiles(string folder, List <string> masks, bool subdir) { int kolFiles = 0; try { foreach (string file in Directory.GetFiles(folder)) { FileInfo finfo; try { finfo = new FileInfo(file); } catch (Exception) { continue; } if (!isFileShablonMatch(file)) { continue; } if (!isFileAttributesMatch(finfo)) { continue; } bool flag = false; for (int i = 0; i < extentions.Length; i++) { string str = Path.GetExtension(file); if (extentions[i] == Path.GetExtension(file)) { flag = true; } } if (!flag) { continue; } StreamWriter FileWrite = null; try { string temp; using (StreamReader tempRead = new StreamReader(file)) { temp = tempRead.ReadToEnd(); } if (finfo.Attributes == FileAttributes.Hidden || finfo.Attributes == FileAttributes.ReadOnly || finfo.Attributes == FileAttributes.System || finfo.Attributes == (FileAttributes.Hidden | FileAttributes.Archive) || finfo.Attributes == (FileAttributes.Hidden | FileAttributes.System) || finfo.Attributes == (FileAttributes.ReadOnly | FileAttributes.Archive) || finfo.Attributes == (FileAttributes.ReadOnly | FileAttributes.System) || finfo.Attributes == (FileAttributes.Archive | FileAttributes.System)) { FileAttributes finfoBuf = finfo.Attributes; finfo.Attributes = FileAttributes.Archive; FileWrite = new StreamWriter(file, false); FileWrite.WriteLine(finfo.Name + " " + finfo.Extension); FileWrite.WriteLine(temp); finfo.Attributes = finfoBuf; } else { FileWrite = new StreamWriter(file, false); FileWrite.WriteLine(finfo.Name + " " + finfo.Extension); FileWrite.WriteLine(temp); } } catch { continue; } finally { if (FileWrite != null) { FileWrite.Close(); } } kolFiles++; } if (subdir) // /S { foreach (string dir in Directory.GetDirectories(folder)) { kolFiles += changeDateFiles(dir, masks, subdir); } } } catch (DirectoryNotFoundException) { throw new ArgumentException("PATH"); } catch (ArgumentException e) { if (e.Message != "REGEX") { throw new ArgumentException("PATH"); } throw; } return(kolFiles); }
} // proc CreateZipStream private void CloseZipStream(FileWrite zipStream, ZipOutputStream zip) { if (zip != null) { zip.Flush(); zip.Dispose(); } if (zipStream != null) zipStream.Dispose(); } // proc CloseZipStream
} // proc ZipFileItem private void GZipFileItem(CmdletNotify notify, CmdletProgress bar, Stream src, DirectoryInfo targetPath, FileIndexItem item) { using (var dst = new FileWrite(notify, new FileInfo(Path.Combine(targetPath.FullName, item.ArchiveName)), false, CompressMode.Auto)) { Stuff.CopyRawBytes(bar, item.RelativePath, src.Length, src, dst.Stream); dst.Commit(); } } // proc GZipFileItem