Beispiel #1
0
        private Result UploadBug(string message, string log)
        {
            var result = new Result()
            {
                Status  = "error",
                Message = "提交失败!"
            };

            try {
                var data = new Dictionary <string, object>()
                {
                    { "projectId", Config["ProgramId"].Integer },
                    { "message", message },
                    { "log", log },
                    { "version", Config["Version"].Value }
                };
                var builder   = new LSBuilder();
                var path      = $"{Config["ApiHost"].Value}/{Config["FeedbackUrl"].Value}";
                var resultObj = builder.Post(path, data);
                resultObj.GetValue(ref result);
            } catch (Exception e) {
                Console.Write(e.StackTrace);
            }
            return(result);
        }
Beispiel #2
0
 /// <summary>
 /// 提交bug
 /// </summary>
 /// <param name="remark"></param>
 /// <param name="contact"></param>
 /// <param name="buglog"></param>
 /// <returns></returns>
 internal static bool UploadBug(string remark, string contact, string log, string type)
 {
     try {
         var data = new Dictionary <string, object>()
         {
             { "remark", remark },
             { "contact", contact },
             { "log", log },
             { "type", type },
             { "version", Version }
         };
         var builder   = new LSBuilder();
         var resultObj = builder.Post(Config["DebugUrl"].Value, data);
         var result    = (bool)resultObj.GetValue(typeof(bool));
         return(result);
     } catch (Exception e) {
         Console.Write(e.StackTrace);
     }
     return(false);
 }