【问题标题】:'Cannot find type System.Resources.ResourceSet in module mscorlib.dll' in windows phone 8.1 appwindows phone 8.1 应用程序中的“在模块 mscorlib.dll 中找不到类型 System.Resources.ResourceSet”
【发布时间】:2015-11-30 19:16:37
【问题描述】:
private void LoginButton_Click(object sender, RoutedEventArgs e)
{
     if(username.Text == "")           
          MessageBox.Show("Enter username");
     else if (password.Password == "")            
          MessageBox.Show("Enter password");
     else if (username.Text == "anve" && password.Password == "123")
     {
          MessageBox.Show("Success !");
          Frame.Navigate(typeof(List));
     }
     else
          MessageBox.Show("Enter Valid Credentials");            
}

我正在为我的应用创建登录页面。我添加了 System.Windows.Forms 引用并使用了 MessageBox.Show。但它给出了一个错误“在模块 mscorlib.dll 中找不到类型 System.Resources.ResourceSet”。

【问题讨论】:

    标签: c#


    【解决方案1】:

    您不能在 Windows Phone 8.1 项目中使用 Windows.Forms 命名空间。

    改用 MessageDialog

    private async void ShowMessageDialog()
    {
       MessageDialog msgbox = new MessageDialog("Hello!"); 
       await msgbox.ShowAsync();  
    }
    

    或更短的版本

    await new MessageDialog("Hello!").ShowAsync();
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-08-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-02-25
      相关资源
      最近更新 更多