0
点赞
收藏
分享

微信扫一扫

VB.Net中异常的迭代捕捉

Dim 
   a  
  As 
    
  Integer 
    
  = 
    
  10 
  
         
  Dim 
   b  
  As 
    
  Integer 
    
  = 
    
  20 
  
         
  Dim 
   c  
  As 
    
  Integer 
    
  = 
    
  10 
  
         
  Dim 
   i  
  As 
    
  Integer 
  
         
  Dim 
   liu  
  As 
    
  Integer 
  
         
  Dim 
   aaa  
  As 
    
  New 
   System.Text.StringBuilder
         
  Try 
  
             
  For 
   i  
  = 
    
  0 
    
  To 
    
  20 
  
                 
  If 
   b  
  < 
    
  10 
    
  Then 
   a  
  = 
   a  
  + 
    
  1 
  
                 
  Try 
  
                    liu  
  = 
   (b  
  / 
   (a  
  - 
   c))
                    aaa.AppendLine( 
  " 
  ok: 
  " 
    
  & 
   b.ToString)
                     
  Exit 
    
  For 
  
                 
  Catch 
   ex  
  As 
   Exception
                    aaa.AppendLine( 
  " 
  error: 
  " 
    
  & 
   b.ToString)
                    b  
  = 
   b  
  - 
    
  1 
  
                     
  If 
   b  
  < 
    
  15 
    
  Then 
  
                         
  Throw 
    
  New 
   Exception( 
  " 
  error 
  " 
  )
                     
  End 
    
  If 
  
                 
  End 
    
  Try 
  
             
  Next 
  
             
  Me 
  .TextBox1.Text  
  = 
   aaa.ToString
         
  Catch 
   ex  
  As 
   Exception
             
  MsgBox 
  ( 
  " 
  oooo 
  " 
  )
         
  End 
    
  Try 
  
         
  MsgBox 
  (b.ToString)
         
  MsgBox 
  ( 
  " 
  www 
  " 
  )

举报

相关推荐

0 条评论