예제 #1
0
 public static LicenseResult Regist(string url, string hardwareId, string componentName, string guid, int dayCount)
 {
     try
     {
         //const string Url = "http://www.netkidxp.cn:8000/registLisence";
         var dic = new SortedDictionary <string, string>
         {
             { "hardware_id", hardwareId },
             { "guid", guid },
             { "component_name", componentName },
             { "day_count", dayCount.ToString() },
         };
         var           jsonParam   = JsonConvert.SerializeObject(dic);
         string        responseStr = Post(url, jsonParam);
         ResponseData  response    = JsonConvert.DeserializeObject <ResponseData>(responseStr);
         LicenseResult result      = new LicenseResult(ResponseResult.SUCCESS, response);
         return(result);
     }
     catch (Exception exp)
     {
         ResponseResult r = new ResponseResult(false, exp.Message);
         return(new LicenseResult(r, null));
     }
 }
예제 #2
0
 public LicenseResult(ResponseResult result, ResponseData data)
 {
     Result = result;
     Data   = data;
 }