mirror of
https://github.com/huiyadanli/RevokeMsgPatcher.git
synced 2025-05-23 22:06:06 +08:00
[#] 包裹一些错误不再向外抛出
This commit is contained in:
parent
bb9a82a657
commit
62248f12e6
|
@ -259,7 +259,7 @@ namespace RevokeMsgPatcher
|
|||
|
||||
private void radioButtons_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
ga.RequestPageView(GetCheckedRadioButtonNameEn() + "_switch");
|
||||
ga.RequestPageView(GetCheckedRadioButtonNameEn() + "/switch", "切换标签页");
|
||||
EnableAllButton(false);
|
||||
RadioButton radioButton = sender as RadioButton;
|
||||
// 切换使用不同的防撤回对象
|
||||
|
|
|
@ -39,24 +39,32 @@ namespace RevokeMsgPatcher.Utils
|
|||
|
||||
public async Task RequestPageViewAsync(string page, string title = null)
|
||||
{
|
||||
if (!page.StartsWith("/"))
|
||||
try
|
||||
{
|
||||
page = "/" + page;
|
||||
if (!page.StartsWith("/"))
|
||||
{
|
||||
page = "/" + page;
|
||||
}
|
||||
// 请求参数
|
||||
var values = new Dictionary<string, string>
|
||||
{
|
||||
{ "v", "1" }, // 当前必填1
|
||||
{ "tid", tid },
|
||||
{ "cid", cid },
|
||||
{ "ua", UserAgent },
|
||||
{ "t", "pageview" },
|
||||
{ "sr", sr },
|
||||
{ "dp", page },
|
||||
{ "dt", title },
|
||||
};
|
||||
var content = new FormUrlEncodedContent(values);
|
||||
var response = await client.PostAsync(GAUrl, content);
|
||||
}
|
||||
// 请求参数
|
||||
var values = new Dictionary<string, string>
|
||||
catch (Exception ex)
|
||||
{
|
||||
{ "v", "1" }, // 当前必填1
|
||||
{ "tid", tid },
|
||||
{ "cid", cid },
|
||||
{ "ua", UserAgent },
|
||||
{ "t", "pageview" },
|
||||
{ "sr", sr },
|
||||
{ "dp", page },
|
||||
{ "dt", title },
|
||||
};
|
||||
var content = new FormUrlEncodedContent(values);
|
||||
var response = await client.PostAsync(GAUrl, content);
|
||||
|
||||
Console.WriteLine("GAHelper:" + ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public void RequestPageView(string page, string title = null)
|
||||
|
|
Loading…
Reference in New Issue
Block a user