反射与接口

时间:2022-09-10 09:51:31
【文件属性】:
文件名称:反射与接口
文件大小:183KB
文件格式:PDF
更新时间:2022-09-10 09:51:31
反射与接口 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace 第三方公司插件 { using 记事本公司提供的插件标准; public class PlugOne:IPlug { public string PlugName { get { return "全部变成大写"; } } public string ProcessText(string strOri) { return strOri.ToUpper(); } } } using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace 第三方公司插件 { using 记事本公司提供的插件标准; public class PlugTwo:IPlug { public string PlugName { get { return "全部变成小写"; } } public string ProcessText(string strOri) { return strOri.ToLower(); } } } using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace 记事本公司提供的插件标准 { public interface IPlug { string ProcessText(string strOri); string PlugName { get; } } } using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace 记事本主程序 { using System.Reflection; using System.IO; using 记事本公司提供的插件标准; public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { //获取正在运行的程序集 Assembly ass = Assembly.GetExecutingAssembly(); //获取程序集的4种方法 //Assembly ass1 = this.GetType().Assembly; //Assembly[] asses = AppDomain.CurrentDomain.GetAssemblies();

网友评论