var page
是我從用戶表單中獲得的文本框。從那var page
我做了下面的代碼。如何處理「if conditon」變量?
希望你從代碼中明白,所以我不需要更多地解釋這一點。
雖然我使用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)
{
// .... //
}
}
錯誤 -
你真的不需要強制標籤到您的標題。 [閱讀這個常見問題條目的更多信息,謝謝。](http://meta.stackexchange.com/questions/19190/should-questions-include-tags-in-their-titles) – Will