これvar page
は、ユーザーフォームのテキストボックスから得たものです。そこからvar page
、以下のコードを実行しました。
コードから理解していただければ幸いです。これについてはこれ以上説明する必要はありません。
を使用している間page
、if condition
以下のエラーが表示されます。それを取り除く方法は?
コード;
protected override void OnNavigatedTo(NavigationEventArgs e)
{
base.OnNavigatedTo(e);
if (NavigationContext.QueryString.ContainsKey("Page"))
{
var page = NavigationContext.QueryString["Page"];
IsolatedStorageSettings settings = IsolatedStorageSettings.ApplicationSettings;
if (!settings.Contains("qsPage"))
{
settings.Add("qsPage", page);
}
else
{
settings["qsPage"] = page;
yourWebBrowser.Navigate(new Uri("/f" + page + ".html", UriKind.Relative));
}
}
コードでエラーが発生します。
private void def(object sender, EventArgs e)
{
int num = 0;
var page = IsolatedStorageSettings.ApplicationSettings["qsPage"];
if (int.TryParse(page, out num) && num > 0 && num < 455)
{
// .... //
}
}
エラー-
Error 1: Argument 1: cannot convert from 'object' to 'string'
Error 2: The best overloaded method match for 'int.TryParse(string, out int)' has some invalid arguments