错误:扩展方法必须在顶级静态类(CS1109)中定义可以启动和停止,并在需要时将倒计时值设置为10分钟。但是我收到一个我不太明白的错误。我不太擅长C#,所以这里是代码:有人可以帮我一下吗?想想我在框架3.0上运行的是什么?使用System.Collections.Generic;使用System.ComponentModel;使用系统数据;使用系统绘图;使用System.Linq;使用系统文本;使用System.Windows.Forms;使用系统定时器;namespacePauseMaster{publicpartialclassMainForm:Form{publicMainForm(){InitializeComponent();}privatevoidMainForm_Load(objectsender,EventArgse){}privateDateTimeendTime;privatevoidbtnStartStop_Click(objectsender,EventArgse){if(btn.Text=="START"){inthours=int.Parse(string.IsNullOrEmpty(txtCountFromHour.TextBox.Text)||txtCountFromHour.TextBox.Text=="计时器”?“0”:txtCountFromHour.TextBox.Text);intmins=int.Parse(string.IsNullOrEmpty(txtCountFromMin.TextBox.Text)||txtCountFromMin.TextBox.Text=="minutter"?"0":txtCountFromMin.TextBox.Text);.TextBox.Text)||txtCountFromSec.TextBox.文本==“sekunder”?“0”:txtCountFromSec.TextBox.Text);endTime=DateTime.Now.AddHours(小时).AddMinutes(分钟).AddSeconds(秒);timer1.Enabled=true;btnStartStop.Text="停止";}else{timer1.Enabled=false;btnStartStop.Text="开始";}}privatevoidtimer1_Tick(objectsender,EventArgse){if(endTime<=DateTime.Now){timer1.Enabled=false;lblTimer.Text="00:00:00";btnStartStop.Text="开始";返回;}TimeSpants=endTime-DateTime.Now;lblTimer.Text=string.Format("{0}:{1}:{2}.{3}",ts.Hours.AddZero(),ts.Minutes.AddZero(),ts.Seconds.AddZero());}publicstaticclassIntExt{publicstaticstringAddZero(thisinti)//在'AddZero'处出现错误{inttotLength=2;intlimit=(int)Math.Pow(10,totLength-1);字符串零="";for(intj=0;j
