private void Main2(ArgsReader ar) { Directory.SetCurrentDirectory(ExtraTools.GetHomeDir()); using (CsvFileReader reader = new CsvFileReader(@"src\syukujitsu.csv")) using (StreamWriter writer = new StreamWriter(@"dest\祝日.js.txt", false, StringTools.ENCODING_SJIS)) { if (reader.ReadRow() == null) // ヘッダ { throw null; // 想定外! } for (; ;) { string[] row = reader.ReadRow(); if (row == null) { break; } if (row.Length != 2) { throw null; // 想定外! } string date = row[0]; string name = row[1]; string[] dateTokens = StringTools.Tokenize(date, "/"); if (dateTokens.Length != 3) { throw null; // 想定外! } int y = int.Parse(dateTokens[0]); int m = int.Parse(dateTokens[1]); int d = int.Parse(dateTokens[2]); int iDate = y * 10000 + m * 100 + d; writer.WriteLine("\t[ " + iDate + ", \"" + name.Replace("\"", "\\\"") + "\" ],"); } } }
private void Main2(ArgsReader ar) { Directory.SetCurrentDirectory(ExtraTools.GetHomeDir()); { HtmlConverter hc = new HtmlConverter() { InputHtmlFile = @"src\index.html", OutputHtmlFile = @"out\index.html", }; hc.Perform(); } { HtmlConverter hc = new HtmlConverter() { InputHtmlFile = @"src\Hatena.html", OutputHtmlFile = @"out\Hatena.html", }; hc.Perform(); } HtmlToDataUrl(@"out\Hatena.html", @"out\Hatena.html.data-url.txt"); { HtmlConverter hc = new HtmlConverter() { InputHtmlFile = @"src2\GeTunnel.html", OutputHtmlFile = @"out\GeTunnel.html", }; hc.Perform(); } }
public static string GetRiotDir() { return(ExtraTools.GetHomeDir("_riot")); }