为什么使用DynamicInvoke?这很好: void SomeMethod() { String.Threading.ThreadStart localFunction = delegate { //语句 } localFunction(); localFunction( ); } 最诚挚的问候, Dustin Campbell Developer Express Inc. Coming from Delphi, I''ve tried to declare a function within a method, butcan''t get the compiler to "swollow it". Is it at all possible? That is: SomeMethod(){ LocalFunction(){//Statements;} LocalFunction();//Statements;LocalFunction();} Thank you! Regards H?kan Johansson 解决方案 Mark, You can in 2.0. You just can''t name them. That''s why they''re calledanonymous methods :) Brian Why use DynamicInvoke? This is fine: void SomeMethod(){String.Threading.ThreadStart localFunction = delegate{// Statements} localFunction();localFunction();} Best Regards,Dustin CampbellDeveloper Express Inc. 这篇关于方法内的功能(简单问题?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
09-26 17:06