在C#asp.net中退出执行路径

In my ASP.Net C# application, when there is an if statement which is true, I want to exit that function and don't want that rest of the lines to be executed in that function.

我该怎么做?

请裸露我,我只是一个初学者!

评论
nquas
nquas
public void Foo()
{
   if (....)
   {
       //First line of code

       return;

       //Second line of code won't fire
   }
}
点赞
评论