[英]How can i deny continue the sub code lines after the try catch exception handling in public static void mvc property
I have an static class with some static void properties.我有一个 static class 和一些 static 空属性。
public static class Payment
{
public static void ChargeTask(int paymentId)
{
//some code
try
{
//some code
}
catch
{
//handle the exceptions.
how can i exit in this property
}
//deny continue this codes
}
}
How can i deny continue the sub code lines after the try catch exception handling?在尝试捕获异常处理后,我如何拒绝继续子代码行?
You use return
keyword like this:您可以像这样使用
return
关键字:
public static class Payment
{
public static void ChargeTask(int paymentId)
{
//some code
try
{
//some code
}
catch
{
//handle the exceptions.
return;
}
//deny continue this codes
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.