| | |
| | | using System.IO; |
| | | using System.Linq; |
| | | using System.Reflection; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Windows.Forms; |
| | | using WebSocketSharp.Server; |
| | | using WindowsFormsApp1.entity; |
| | | using WindowsFormsApp1.entity.tb; |
| | | using WindowsFormsApp1.utils; |
| | |
| | | Application.EnableVisualStyles(); |
| | | Application.SetCompatibleTextRenderingDefault(false); |
| | | AppDomain.CurrentDomain.AssemblyResolve += Resolver; |
| | | CefSettings _settings= new CefSettings(); |
| | | CefSettings _settings = new CefSettings(); |
| | | _settings.PersistSessionCookies = true; |
| | | Cef.Initialize(_settings); |
| | | TestServer(); |
| | | //TestDataBase(); |
| | | Application.Run(new Main()); |
| | | //Application.Run(new TBLogin(2)); |
| | | //TestCookie(); |
| | | // kam(); |
| | | } |
| | | |
| | | //测试服务器 |
| | | private static void TestServer() { |
| | | new Thread(new ThreadStart(()=> { |
| | | var httpServer = new HttpServer("http://127.0.0.1:8091"); |
| | | httpServer.OnGet += (sender,e) => |
| | | { |
| | | var req = e.Request; |
| | | var res = e.Response; |
| | | res.ContentType = "application/json"; |
| | | res.ContentEncoding = Encoding.UTF8; |
| | | JObject obj = new JObject(); |
| | | obj["code"] = 0; |
| | | byte[] contents= System.Text.Encoding.Default.GetBytes(obj.ToString()); |
| | | res.StatusCode = 200; |
| | | res.ContentLength64 = contents.LongLength; |
| | | res.Close(contents, true); |
| | | }; |
| | | httpServer.Start(); |
| | | })).Start(); |
| | | } |
| | | |
| | | //可爱猫测试 |
| | | private static void kam() { |
| | | KeAiMaoUtil.GetLoginState(); |
| | | } |
| | | |
| | | private static void TestDataBase() { |