当前位置 : 主页 > 手机开发 > harmonyos >

VB.Net中异常的迭代捕捉

来源:互联网 收集:自由互联 发布时间:2023-10-08
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.ToSt
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 
  " 
  )
上一篇:AUTOCAD2006自动加载应用程序和lsp程序
下一篇:没有了
网友评论