コード例 #1
0
        private async void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
        {
            var data = new
            {
                version = SettingHelper.GetVersion(),
                time    = DateTime.Now.ToString(),
                device  = Windows.System.Profile.AnalyticsInfo.VersionInfo.DeviceFamily + " " + SystemHelper.SystemVersion(),
                network = SystemHelper.GetNetWorkType(),
                message = exception.Message + "\r\n\r\n" + exception.StackTrace
            };

            try
            {
                await WebClientClass.PostResultsJson(new Uri("https://api.iliili.cn/api/BiliError"), JsonConvert.SerializeObject(data));
            }
            catch (Exception)
            {
                Utils.ShowMessageToast("发送失败");
            }
        }