⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 personinterop.cs

📁 东软内部材料(四)asp等相关的教学案例 
💻 CS
字号:
using System.Reflection;
using System.Runtime.InteropServices;


[assembly:AssemblyKeyFile("PersonInterop.snk")]

namespace Wrox
{
	public interface IPersonInterop
	{
		//person();
		//person(string firstName, string lastName);
		
		string FirstName{get; set;}
		string LastName{get; set;}
		
		string FullName();
	}
	
	public class PersonInterop : IPersonInterop
	{
	  private string _firstName;
	  private string _lastName;

	  public PersonInterop() {}

	  public PersonInterop(string firstName, string lastName)
	  {
		_firstName = firstName;
		_lastName = lastName;
	  }

	  public string FirstName
	  {
		get { return _firstName; }
		set { _firstName = value; }
	  }

	  public string LastName
	  {
		get { return _lastName; }
		set { _lastName = value; }
	  }

	  public string FullName()
	  {
		return _firstName + " " + _lastName;
	  }
	}

    [ClassInterfaceAttribute(ClassInterfaceType.AutoDual)]
	public class PersonInterop1
	{
	  private string _firstName;
	  private string _lastName;

	  public PersonInterop1() {}

	  public PersonInterop1(string firstName, string lastName)
	  {
		_firstName = firstName;
		_lastName = lastName;
	  }

	  public string FirstName
	  {
		get { return _firstName; }
		set { _firstName = value; }
	  }

	  public string LastName
	  {
		get { return _lastName; }
		set { _lastName = value; }
	  }

	  public string FullName()
	  {
		return _firstName + " " + _lastName;
	  }
	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -