我想如果try到异常的话就返回false,正常的话就return true,这样的话return true和return false应该写在哪里阿?多谢!
public static bool InitForm()
{
try
{
....
}
catch
{
....
}
return true;
}
public static bool InitForm()
{
try
{
....
}
catch
{
....
}
return true;
}
解决方案 »
- CommandName="delete" 是什么意思一定要写delete吗?
- 求助--怎样点击一个Button按钮,执行一个存储过程
- 请教?这样谢为什么出错!C#
- 发布网站问题(急救)
- 自定义控件属性如果是dateTime类型,怎么不行呢?
- 做网络硬盘遇到的问题
- 数据源的问题
- automation服务器不能创建对象是怎么回事啊
- Application_Start为什么在服务端不能正常启动
- 水晶报表 将参数值从Decimal转换到DateTime失败
- 在线等待,非常着急,哪位知道c#在web窗体里tab控件的用法,还有就是类似outlook的工具栏是怎么实现的
- 服务器上的软件空间怎样直接安装到客户机上的,就是没提示的那种,它的安装权限打哪来??
{
try
{
....
}
catch
{
return false;
}
return true;
}
public static bool InitForm()
{
bool result=true;
try
{
....
}
catch
{
result = false;
}
return result;
}
{
try{
//....
}
catch
{
//....
result = false;
}
return true;
}
{
try{
//....
return true;
}
catch
{
//....
result = false;
}
}
{
try{
//your other code here
return true;
}
catch
{
result = false;
}
}
推荐
public static bool InitForm()
{
try{
//....
return true;
}
catch
{
//....
result = false;
}
}