在哪个库里面?有例子更好

解决方案 »

  1.   

    System.Windows.Forms.MessageBox.Show("TExt", "caption", MessageBoxButtons.OKCancel);
      

  2.   

    if(System.Windows.Forms.MessageBox.Show("", "", MessageBoxButtons.OKCancel)==DialogResult.OK)
    {
      
    }
    else
    {
    }
      

  3.   

    System.Windows.Forms 命名空间 
    例如:
    System.Windows.Forms.MessageBox.Show("要显示的内容", "提示信息", MessageBoxButtons.OKCancel);
      

  4.   

    错误信息,命名空间不存在system.windows
      

  5.   

    右简工程
    添加引用
    添加System.Windows.Forms.dll
      

  6.   

    MessageBox.Show("要显示的内容", "对话框标题", MessageBoxButtons.OKCancel,MessageBoxButtons.Information);
      

  7.   

    + $exception {"当应用程序不是以 UserInteractive 模式运行时显示模式对话框或窗体是无效操作。请指定 ServiceNotification 或 DefaultDesktopOnly 样式,以显示服务应用程序发出的通知。"} System.Exception {System.InvalidOperationException}
      

  8.   

    估计你建的是Console Application的话就要添加System.Windows.Forms引用了.
      

  9.   

    winform下才有messagebox,在windows service下没有...
      

  10.   

    windows service下没有messagebox的。你只能写个日志啥的。一个服务在运行,你没有理由出错就让他停下来等待。
      

  11.   

    MessageBox跟是不是b/s毫无关系。
    MessageBox只是一个类,b/s是一种网络应用程序的架构方式。MessageBox的应用,在winform应用程序里,直接用
    MessageBox.Show("文本内容");即可,用来提示警告信息的