using System;using System.Net.Http;using System.Net.Http.Headers;using System.Reflection;using System.Threading.Tasks;using System.Windows.Forms;namespace Rappen.XTB.AutoNumManager{public class LogUsage{#region Public Methodspublic static async Task DoLog(string action){try{var ass = Assembly.GetExecutingAssembly().GetName();var version = ass.Version.ToString();var name = ass.Name.Replace(" ", "");action = "ANM-" + action;var query = "t.php" +"?sc_project=10396418" +"&security=95f631d9" +"&java=1" +"&invisible=1" +"&u={2}" +"&camefrom={0} {1}";using (var client = new HttpClient()){client.DefaultRequestHeaders.UserAgent.Add(new ProductInfoHeaderValue(name, version));client.BaseAddress = new Uri("http://c.statcounter.com/");var response = await client.GetAsync(string.Format(query, name, version, action)).ConfigureAwait(continueOnCapturedContext: false);response.EnsureSuccessStatusCode();if (response.IsSuccessStatusCode){response.Content.ReadAsStringAsync();}}}catch { }}#endregion Public Methods#region Internal Methodsinternal static bool PromptToLog(){var msg = "Anonymous statistics will be collected to improve the functionality of Auto Number Manager.\n\n" +"If you do not wish to allow this, open the About window and uncheck the 'Allow statistics' checkbox.";MessageBox.Show(msg, "Statistics", MessageBoxButtons.OK, MessageBoxIcon.Information);return true;}#endregion Internal Methods}}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。