delegate double CalculateMethod(double Diameter);
static CalculateMethod calcMethod;
double result = 0; static void Main(string[] args)
{
calcMethod = new CalculateMethod(Calculate);
calcMethod.BeginInvoke(5, new AsyncCallback(TaskFinished), null);
}
///
///线程调用的函数
///
public static double Calculate(double Diameter)
{
return Diameter * Math.PI;
}
///
///线程完成之后回调的函数
///
public static void TaskFinished(IAsyncResult result)
{
result = calcMethod.EndInvoke(result);
}编译不过 出现 错误 CS0029: 无法将类型“double”隐式转换为“System.IAsyncResult”
static CalculateMethod calcMethod;
double result = 0; static void Main(string[] args)
{
calcMethod = new CalculateMethod(Calculate);
calcMethod.BeginInvoke(5, new AsyncCallback(TaskFinished), null);
}
///
///线程调用的函数
///
public static double Calculate(double Diameter)
{
return Diameter * Math.PI;
}
///
///线程完成之后回调的函数
///
public static void TaskFinished(IAsyncResult result)
{
result = calcMethod.EndInvoke(result);
}编译不过 出现 错误 CS0029: 无法将类型“double”隐式转换为“System.IAsyncResult”
{
double 汗死 = calcMethod.EndInvoke(result);
}
这个类型啊