c# thread 强制取消超时进程

21 6月

c# thread 强制取消超时进程

using System; 
namespace DelegateFuncAction 
{ 
    class Program 
    { 
        static void Main(string[] args) 
        { 
            Func<double, double,double> DoAddtion = calculate.addtion; 
            double result = DoAddtion(20, 30); 
            Console.WriteLine("Func带返回参数委托做加法结果为:{0}",DoAddtion(10,20)); 
            calculate c=new calculate(); 
            Action<double, double> DoSubstraction = c.substraction; 
            DoSubstraction(90, 20); 
        } 
    } 
    class calculate 
    { 
        public static double addtion(double x, double y) 
        { 
            return x + y; 
        } 
        public void substraction(double x, double y) 
        { 
            Console.WriteLine("Action不带返回参数委托做减法结果为:{0}",x-y); 
        } 
    } 
} 

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注