Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27201

Why for loop wont continue?

$
0
0
MY FOR LOOP WONT START.

Code Code:
  1. Public Sub deleteprofile(profilename)
  2.  
  3.         Try
  4.             MsgBox(profilesearchbox.Items.Count) /// WILL PROMPT THE ITEMS COUNT <> 0
  5.        
  6.             For b = 0 To profilesearchbox.Items.Count - 1 Step 1
  7.                 MsgBox(profilesearchbox.Items.Count & " " & b & " " & profilesearchbox.Items(b).text) //DID NOT PROMPT
  8.                 If profilesearchbox.Items(b).text = profilename Then
  9.                     Dim direct As String = adr + "\profile\arb.sec"
  10.                     File.SetAttributes(adr + "\profile\arb.sec", FileAttributes.Normal)
  11.                     Dim lines As New List(Of String)(IO.File.ReadAllLines(direct))
  12.                     'Remove the line to delete, e.g.
  13.                     lines.RemoveAt(B)
  14.                     MsgBox("2")
  15.                     IO.File.WriteAllLines(direct, lines.ToArray())
  16.                     File.SetAttributes(adr + "\profile\arb.sec", FileAttributes.System)
  17.                     File.SetAttributes(adr + "\profile\arb.sec", FileAttributes.Hidden)
  18.                     MsgBox(profilename & " has successfully Deleted", MsgBoxStyle.Information)
  19.  
  20.                 End If
  21.  
  22.             Next
  23.             MsgBox(profilename & " has successasdsad", MsgBoxStyle.Information)
  24.         Catch
  25.         End Try
  26.  
  27.  
  28.     End Sub
It will not proceed here
Quote:

For b = 0 To profilesearchbox.Items.Count - 1 Step 1

Viewing all articles
Browse latest Browse all 27201

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>