Skip to content
This repository has been archived by the owner on Feb 16, 2021. It is now read-only.

Commit

Permalink
把Convert.ToInt32方法改成int.Parse啦!
Browse files Browse the repository at this point in the history
  • Loading branch information
frg2089 committed May 31, 2020
1 parent 2838fcf commit 684a3ec
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions PixivFSUWP/SearchPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -238,18 +238,18 @@ private async void btnSauceNAO_Click(object sender, RoutedEventArgs e)
return;
}
//
ImgurNaoAPI imgurNaoApi = new ImgurNaoAPI(SAUCENAO_API_KEY, IMGUR_API_KEY);
string image = imgurNaoApi.UpLoad(await StorageFileExt.AsByteArray(file)).GetNamedString("link");
int retPid = (int)imgurNaoApi.DownLoad(image).GetNamedNumber("pixiv_id");
Frame.Navigate(typeof(IllustDetailPage), retPid, App.FromRightTransitionInfo);
//ImgurNaoAPI imgurNaoApi = new ImgurNaoAPI(SAUCENAO_API_KEY, IMGUR_API_KEY);
//string image = imgurNaoApi.UpLoad(await StorageFileExt.AsByteArray(file)).GetNamedString("link");
//int retPid = (int)imgurNaoApi.DownLoad(image).GetNamedNumber("pixiv_id");
//Frame.Navigate(typeof(IllustDetailPage), retPid, App.FromRightTransitionInfo);
}
private void GoPixivID_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
{
try
{
Frame.Navigate(typeof(IllustDetailPage), Convert.ToInt32(asbGTPID.Text), App.FromRightTransitionInfo);
Frame.Navigate(typeof(IllustDetailPage), int.Parse(asbGTPID.Text), App.FromRightTransitionInfo);
}
catch
catch(OverflowException)
{
//吞了异常。一般是由于输入的数字过大,超过了Int32的限制导致
}
Expand Down

0 comments on commit 684a3ec

Please sign in to comment.