请问,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