日期:2014-05-17  浏览次数:20812 次

请问,dll文件为什么不能MessageBox.Show()
创建一个dll文件,如下:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
namespace aaaaa
{
    public class Person
    {
        public void Say()  
        {           
           MessageBox.Show("dfgfg");            
        }       
    }
}


不能使用MessageBox,为什么?
添加using System.Windows.Forms;也不能添加,为什么?
------最佳解决方案--------------------
先要引用Systen.Windows.Forms库。
------其他解决方案--------------------
先在工程中引用 System.Windows.Forms.dll