这个方法不知道拿来干什么的
public static void CheckCondition(bool condition, String errorText, int lineNumber)
{
//Test the condition
if ( !condition )
{
//Assert and throw if the condition is not met
String detailMessage;
GenerateStackTrace(lineNumber, out detailMessage);
Debug.Fail(errorText, detailMessage);
throw new ApplicationException(errorText);
}
}public static int LineNumber
{
get
{
try
{
//
// Get the trace information with file information by skipping
// this function and then reading the top stack frame.
//
return (new StackTrace(1, true)).GetFrame(0).GetFileLineNumber();
}
catch
{
} return 0;
}
}
public static void CheckCondition(bool condition, String errorText, int lineNumber)
{
//Test the condition
if ( !condition )
{
//Assert and throw if the condition is not met
String detailMessage;
GenerateStackTrace(lineNumber, out detailMessage);
Debug.Fail(errorText, detailMessage);
throw new ApplicationException(errorText);
}
}public static int LineNumber
{
get
{
try
{
//
// Get the trace information with file information by skipping
// this function and then reading the top stack frame.
//
return (new StackTrace(1, true)).GetFrame(0).GetFileLineNumber();
}
catch
{
} return 0;
}
}
解决方案 »
- 数据优化,从数据库到代码,希望大家多给点意见?
- 郁闷,关于HTML的小问题!
- GridView中怎么判断行被选中?
- 我的WIN2003装了VS2005后, 发现没有MDM服务.....无法用IIS进行网站调试 -_-
- 在本地运行没问题,为什么上传到空间,就有这个错误呢?
- 【请教高手】如何找到DataGrid模板列中的DropDownList?该DropDownList放置在EditItemTemplate里面
- 在VS里使用FreeTextBox HTML编辑器出现点问题!
- IP地址的正则表达式怎么写
- 怎样使用Session.SessionID将用户和购物车联系起来?能给具体实现的代码吗?
- why???后退按钮的奇怪问题?(重谢)
- 帮助看一下ASP.NET的运行问题
- 请问在ASP.NET中能实现脚本引擎吗??!!!!!
(bool condition, String errorText, int lineNumber)condition是条件,errorText是出错的原因,lineNumber是得到当前出错的代码行数