Ejemplo n.º 1
0
        internal static HttpStatusCode uploadException(Exception e)
        {
            string text = new Random().Next(1000, 10000).ToString();
            Dictionary <string, string> dictionary = new Dictionary <string, string>();

            dictionary.Add("message", e.Message);
            HttpContent content = new FormUrlEncodedContent(new Dictionary <string, string>
            {
                {
                    "a",
                    DESHelper.Encrypt(JsonConvert.SerializeObject(dictionary), Resources.secertKey, text)
                },
                {
                    "b",
                    Resources.appId
                },
                {
                    "c",
                    Resources.version
                },
                {
                    "d",
                    text
                }
            });
            Task <HttpResponseMessage> task = httpClient.PostAsync(Resources.baseUrl + "c", content);

            try
            {
                return(task.Result.StatusCode);
            }
            catch (Exception)
            {
                return((HttpStatusCode)0);
            }
        }