private void Start() { from_MakePath = this; Color_P1 = GameColtoler.Color_P1; Color_P2 = GameColtoler.Color_P2; Color_P3 = GameColtoler.Color_P3; Color_P4 = GameColtoler.Color_P4; InvokeRepeating("check_toket_p1", 1f, 1f); InvokeRepeating("check_toket_p2", 1f, 1f); InvokeRepeating("check_toket_p3", 1f, 1f); InvokeRepeating("check_toket_p4", 1f, 1f); }
/// <summary> /// xlsx出力 /// データ取得 /// 出力ファイルパス作成 /// csv書込み /// </summary> /// <param name="outputDirPath">出力フォルダパス</param> /// <param name="fileName">出力ファイル名</param> /// <param name="connStr">DB接続文字列</param> /// <param name="sql">実行するSQL文</param> /// <param name="param">バインドパラメータのDictionary</param> public static void OutputXlsx(string outputDirPath, string fileName, string connStr, string sql, Dictionary <string, string> param = default(Dictionary <string, string>)) { try { if (!Directory.Exists(outputDirPath)) { throw new DirectoryNotFoundException($"{outputDirPath} というフォルダは存在しません"); } var data = getData(connStr, sql, param); var filePath = $"{Path.Combine(outputDirPath, fileName)}.xlsx"; filePath = MakePath.CreateUniqueFileName(filePath); WriteXlsx.Write(filePath, data); } catch (Exception ex) { throw ex; } }
/// <summary> /// csv出力 /// データ取得 /// 出力ファイルパス作成 /// csv書込み /// </summary> /// <param name="outputDirPath">出力フォルダパス</param> /// <param name="fileName">出力ファイル名</param> /// <param name="connStr">DB接続文字列</param> /// <param name="sql">実行するSQL文</param> /// <param name="param">バインドパラメータのDictionary[key:バインドパラメータ,val:置き換えるデータ値]</param> public static void OutputCsv(string outputDirPath, string fileName, string connStr, string sql, Dictionary <string, string> param = default(Dictionary <string, string>)) { try { if (!Directory.Exists(outputDirPath)) { throw new DirectoryNotFoundException($"{outputDirPath} というフォルダは存在しません"); } var data = getData(connStr, sql, param); var filePath = $"{Path.Combine(outputDirPath, fileName)}.csv"; filePath = MakePath.CreateUniqueFileName(filePath); File.AppendAllText(filePath, data.CsvData, Encoding.UTF8); } catch (Exception ex) { throw ex; } }