程序代码private void CheckState( ){// The Old way:#if DEBUG Trace.WriteLine( "Entering CheckState for Person" ); // Grab the name of the calling routine: string methodName = new StackTrace( ).GetFrame( 1 ).GetMethod( ).Name; Debug.Assert( _lastName != null, methodName, "Last Name cannot be null" ); Debug.Assert( _lastName.Length > 0, methodName, "Last Name cannot be blank" ); Debug.Assert( _firstName != null, methodName, "First Name cannot be null" ); Debug.Assert( _firstName.Length > 0, methodName, "First Name cannot be blank" ); Trace.WriteLine( "Exiting CheckState for Person" );#endif}程序代码private void CheckState( ){// The Old way:#if 你的当前访问异常,请进行认证后继续阅读剩余内容。 提交