public class TestClass{ // 添加Obsolete特性 [System.Obsolete("请使用新的SendMsg()")] public static void ShowMsg() { } public static void SendMsg() { }}class Program{ static void Main(string[] args) { TestClass.ShowMsg(); }}