Beispiel #1
0
        static void Main(string[] args)
        {
            LJC.FrameWork.Comm.HttpRequestEx httpreq = new HttpRequestEx();
            httpreq.Accept         = "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3";
            httpreq.AcceptLanguage = "zh-CN,zh;q=0.9";

            httpreq.UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36";
            var resp = httpreq.DoRequest("https://hippo.gf.com.cn/?source=STORE&needLoginTrade=true#StockTrade", string.Empty);

            MySession server = new MySession();

            server.StartServer();

            Console.Read();

            //foreach (var item in new HeapSortTool<int>(new[] { 100, 2, 4, 5, 1, 3, 6, 9, 7, 8, 0, 4 }).Sort())
            //{
            //    Console.Write(item + " ");
            //}

            //Console.Read();
            //return;
            List <string> names = new List <string>();

            for (int ii = 0; ii < 100000; ii++)
            {
                names.Add("name" + ii);
            }
            SortTool <string> ss = new HeapSortTool <string>(names);

            DateTime time = DateTime.Now;
            //names= names.OrderBy(p => p).ToList();
            var results = ss.Sort();

            Console.WriteLine("用时:" + DateTime.Now.Subtract(time).TotalMilliseconds + ",比较次数:" + ss.CompareCount + ",置换次数:" + ss.ExchangeCount);
            foreach (var item in results)
            {
                Console.WriteLine(item);
                Thread.Sleep(100);
            }
            Console.Read();
            return;


            TestLocaldb();
            TestLocaldbRead();

            ShellUtil.CallShell(@"E:\Work\learn\Git\Ljc.JFrameWork\lib\JavaService-2.0.10.64\install.bat", null);
            return;

            int cnt = 0;

            while ((cnt++) < 3)
            {
                long l1 = Environment.TickCount & long.MaxValue;
                for (int ik = 0; ik < 10000; ik++)
                {
                    var info = LJC.FrameWork.SOA.ESBClient.DoSOARequest2 <GetPersonResponse>(1000, 1, new GetPersonRequest
                    {
                        Id = 9999
                    });
                }

                long l2 = Environment.TickCount & long.MaxValue;

                Console.WriteLine(l2 - l1);
            }

            Console.Read();

            return;

            int ix = 0;

            while (true)
            {
                var msgtxt = @"据了解,群众提出的意见主要集中在单身申请家庭年龄、离婚限制年限、住房转出记录、东西城房源以及能否落户、入学等方面。
  制定政策引导单身青年先租房
  一是关于单身申请年龄。有群众反映30岁年龄限制过高,同时也有群众赞成,认为共有产权住房应优先保障家庭结构稳定且人口较多的家庭。不满30周岁单身家庭可“先租后买”,形成梯度消费。据此,市住建委表示下一步,将制定支持政策,引导单身青年通过租房方式解决住房困难问题,实现有效衔接。
  “无住房转出记录”将明确为“在本市无住房转出记录”
  二是关于离婚、有住房转出记录人员限制申请。对于离婚人员申请问题,市住建委已在《办法》中明确仅限制“有住房家庭夫妻离异后单独提出申请”的情形,对离婚前家庭成员无住房或再婚家庭,不受此限制。
  对于要求无住房转出记录,目的是聚焦无房刚需家庭首次购房需求,符合回归自住属性、杜绝投资投机需求。同时,采纳部分群众提出应将“无住房转出记录”明确为“在本市无住房转出记录”的意见建议,在《办法》中予以修改。";

                var enbytes       = LJC.FrameWork.EntityBuf.EntityBufCore.Serialize(msgtxt, false);
                var comparebytes  = LJC.FrameWork.Comm.GZip.Compress(enbytes);
                var obytest       = System.Text.Encoding.UTF8.GetBytes(msgtxt);
                var comparebytes2 = LJC.FrameWork.Comm.GZip.Compress(obytest);

                var str = LJC.FrameWork.SOA.ESBClient.DoSOARequest2 <string>(100, 100, msgtxt + (ix++));
                Console.WriteLine(str);

                Thread.Sleep(1000);
            }
            Console.Read();


            LJC.FrameWork.SocketApplication.SocketEasyUDP.Server.SessionServer serverbase = new LJC.FrameWork.SocketApplication.SocketEasyUDP.Server.SessionServer(19000);
            serverbase.StartServer();

            Console.WriteLine("服务启动...");

            Console.Read();

            var list = LJC.FrameWork.Data.QuickDataBase.DataContextMoudelFactory <RunConfig> .GetDataContext().ExecuteList();

            var newrunconfig = list.FirstOrDefault();

            newrunconfig.ID = 0;
            LJC.FrameWork.Data.QuickDataBase.DataContextMoudelFactory <RunConfig> .GetDataContext(newrunconfig).Add();

            var list2 = LJC.FrameWork.Data.QuickDataBase.DataContextMoudelFactory <RunConfig> .GetDataContext().ExecuteList();

            newrunconfig.UserID = "123456";
            LJC.FrameWork.Data.QuickDataBase.DataContextMoudelFactory <RunConfig> .GetDataContext(newrunconfig).Update();

            list2 = LJC.FrameWork.Data.QuickDataBase.DataContextMoudelFactory <RunConfig> .GetDataContext().ExecuteList();

            LJC.FrameWork.Data.QuickDataBase.DataContextMoudelFactory <RunConfig> .GetDataContext(new RunConfig { ID = list2.Last().ID }).Del();

            list2 = LJC.FrameWork.Data.QuickDataBase.DataContextMoudelFactory <RunConfig> .GetDataContext().ExecuteList();

            Console.Read();
            return;

            ThreadPool.SetMinThreads(100, 100);



            //TestGZIP();
            //TestMs();

            //Console.Read();
            //return;

            var client = LJC.FrameWork.Redis.RedisManager.GetClient("Host_Redis");

            client.Set("name", "ljc123456asdfasdfdsaf");

            int i = 0;

            System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
            sw.Restart();
            while (i++ < 100000)
            {
                var s = client.Get <string>("name");
            }

            sw.Stop();

            Console.WriteLine("取到数据,用时ms:" + sw.ElapsedMilliseconds);

            Console.Read();
        }