Ejemplo n.º 1
0
 static void Main()
 {
     user = new Models.UserInfo();
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     Application.Run(new LogIn());
 }
Ejemplo n.º 2
0
        //登录
        public bool SignIn(Models.UserInfo user)
        {
            HttpContent content = new StringContent(" ", Encoding.UTF8, "application/json");

            content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/x-www-form-urlencoded");
            var x = HttpClient.PostAsync(baseurl + "login?" + user.ToString(), content).Result;

            if (x.StatusCode.ToString() == "OK")
            {
                Token = rx.Match(x.Content.ReadAsStringAsync().Result).Groups[1].Value;
                return(true);
            }
            else
            {
                return(false);
            }
        }