コード例 #1
0
        static void Main(string[] args)
        {
            DTLib.DTEntry.Run();

            DTLib.DTEntry.looper.SendMsg(new DTLib.core.Message("set connection", () =>
            {
                if (!DTLib.DTEntry.Setters.ContainsKey(typeof(CfgDbConnectionSetter)))
                {
                    CfgDbConnectionSetter cfgProvider = new CfgDbConnectionSetter();
                    cfgProvider.Set("mongodb://192.168.15.113:27017@Events");
                    Console.WriteLine("set connection string");
                }
            }));
            Console.ReadLine();

            DTLib.DTEntry.looper.SendMsg(new DTLib.core.Message("set cfg path", () => {
                if (!DTLib.DTEntry.Setters.ContainsKey(typeof(CfgLogPathSetter)))
                {
                    CfgLogPathSetter cfgPathRegister = new CfgLogPathSetter();
                    cfgPathRegister.Set(@"E:\Work\yashanyang_view10\Casino\AH\Data\Log");
                    Console.WriteLine("set log path");
                }
            }));
            Console.ReadLine();

            var collection = DTLib.DTEntry.DbProvider.Query <Event>("Event");
            var filter     = Builders <Event> .Filter.Eq(ev => ev.date, "2017-04-06");

            collection = DTLib.DTEntry.DbProvider.Query <Event>("Event", filter);
            Console.ReadLine();

            DTLib.DTEntry.looper.SendMsg(new DTLib.core.Message("exit"));
            Console.ReadLine();
        }
コード例 #2
0
        public void SetDBUri(string value)
        {
            //mongodb://192.168.15.113:27017@Events
            byte[] outputb = Convert.FromBase64String(value);
            string orgStr  = Encoding.Default.GetString(outputb);

            DTEntry.looper.SendMsg(new DTLib.core.Message("set connection", () =>
            {
                if (!DTEntry.Setters.ContainsKey(typeof(CfgDbConnectionSetter)))
                {
                    CfgDbConnectionSetter cfgProvider = new CfgDbConnectionSetter();
                    cfgProvider.Set(orgStr);
                }
            }));
        }