示例#1
0
        public static bool Login(string uname, string password)
        {
            DefaultAnswObject auth = JsonConvert.DeserializeObject <DefaultAnswObject>(SendRequest(new Dictionary <string, string>()
            {
                { "uname", uname },
                { "password", password }
            }, "POST", "login"));

            if (auth.successful)
            {
                cookieUID = auth.uid;
                return(true);
            }
            else
            {
                MessageBox.Show(auth.error);
                return(false);
            }
        }
示例#2
0
 public static bool SetComment(string comment, HotelObject hotel)
 {
     if (cookieUID != "")
     {
         DefaultAnswObject auth = JsonConvert.DeserializeObject <DefaultAnswObject>(SendRequest(new Dictionary <string, string>()
         {
             { "hid", hotel.id.ToString() },
             { "comment", comment }
         }, "POST", "setComment"));
         if (auth.successful)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     return(false);
 }