但是要在引用中添加System.Drawing和System.Windows.Forms的DLL引用
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Windows.Forms;
namespace ConsoleApplication12
{
class Program
{
static void Main(string[] args)
{
NotifyIcon icon = new NotifyIcon();
icon.Icon = new Icon(@"C:\20110301120829400.ico");
icon.Text = "Test";
icon.Visible = true;
Console.ReadLine();
}
}
}