做个记录,写个示例

using System;


class Rubbish
{
    public void Say() 
    { 
        Console.Write("Hello"); 
    }
}
static class RubbishExtensions
{
    public static void Say(this Rubbish argRubbish, string argString)
    {
        Console.Write(argString);
    }
}
class Program
{
    static void Main(string[] args)
    {
        Rubbish theRubbish = new Rubbish();
        theRubbish.Say("Hey");
        Console.ReadKey(false);
    }
}

 

相关文章:

  • 2021-09-27
  • 2022-12-23
  • 2021-12-09
  • 2022-12-23
  • 2022-12-23
  • 2021-07-26
  • 2022-03-09
  • 2022-12-23
猜你喜欢
  • 2021-11-11
  • 2021-05-29
  • 2021-06-17
  • 2021-12-15
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案