admin 管理员组文章数量: 1184232
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using dlltest;
namespace yindlltest
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
int a, b,c;
a = Convert.ToInt32(this.textBox1.Text);
b = Convert.ToInt32(this.textBox2.Text);
c = Class1.sum(a, b);
this.label3.Text = c.ToString();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace dlltest
{
public class Class1
{
public static int sum(int i, int j)
{
return i + j;
}
}
}
把一些共同的方法编译到dll中,这样可以屏蔽一些代码。
版权声明:本文标题:将方法编译到dll以优化代码 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.roclinux.cn/b/1773815402a3566029.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论