void Main(bool useDemoServer, bool loadFromDB) { SqliteExtension.UseSqlite("test.sqlite"); LoginInfo user = GetUserInfo(useDemoServer); using (XingClient xing = new XingClient(useDemoServer)) { if (xing.ConnectWithLogin(user) == false) { Console.WriteLine(xing.ErrorMessage); return; } if (loadFromDB == true) { var items = XQt8425.ReadFromDB(); foreach (var item in items) { item.Dump(Console.Out, DumpOutputType.Inline); } } else if (useDemoServer) { var items = XQt8425.Get(); foreach (var item in items) { item.Dump(Console.Out, DumpOutputType.Inline); } items.WriteToDB(replace: true); } else { using (var query = new XQt8425()) { if (query.Request() < 0) { Console.WriteLine("Failed to send request"); } XQt8425OutBlock[] outBlocks = query.GetBlocks(); foreach (var item in outBlocks) { if (item.IsValidData == true) { item.Dump(Console.Out, DumpOutputType.Inline); } } } } } }
void Main(bool useDemoServer) { SqliteExtension.UseSqlite("test.sqlite"); LoginInfo user = GetUserInfo(useDemoServer); using (XingClient xing = new XingClient(useDemoServer)) { if (xing.ConnectWithLogin(user) == false) { Console.WriteLine(xing.ErrorMessage); return; } XQt8430.Get(XQt8430Gubun.전체).WriteToDB(); XQt8425.Get().WriteToDB(); } }
private string GetTmCode(string tab) { StringBuilder sb = new StringBuilder(); sb.AppendLine($"{tab}public partial class TMCODE"); sb.AppendLine($"{tab}{{"); var items = XQt8425.Get(); Dictionary <string, int> names = new Dictionary <string, int> (); foreach (var item in items) { sb.AppendLine($"{tab}\tpublic const string {ToVariableName(item.tmname, names)} = \"{item.tmcode}\"; // {item.tmname}"); } sb.AppendLine($"{tab}}}"); return(sb.ToString()); }