引用外部程序集

引用外部程序集:

先看一个程序代码实例:

using System;

using System.Drawing;

using System.Windows.Forms;

 

namespace TestWin

{

public class SimpleForm : Form

{

public SimpleForm()

{

InitializeComponent();

}

private System.ComponentModel.IContainer components = null;

 

protected override void Dispose(bool disposing)

{

if(disposing)

{

if(components != null)

{

components.Dispose();

}

}

base.Dispose(disposing);

}

private void InitializeComponent()

{

this.SuspendLayout();

this.AutoScaleDimensions = new System.Drawing.SizeF(6F,12F);

this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;

this.ClientSize = new System.Drawing.Size(292,273);

this.Name = "SimpleForm";

this.Text = "SimpleForm";

this.ResumeLayout(false);

}

 

[STAThread]

 

private static void Main(string[] args)

{

Application.EnableVisualStyles();

Application.SetCompatibleTextRenderingDefault(false);

Application.Run(new SimpleForm());

}

 

}

 

}

 

在这个程序中,开始的时候使用using语句引用几个外部程序集,在编译的时候需要使用参数reference】将使用到的程序集添加到编译时的引用中去,在引用程序集的时候,可以添加多个程序集,之间使用分隔号隔开就可以了。

上面这个程序运行的命令是:



运行的结果:


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值