Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hello all,

 

I have a problem that I can't seem to figure out.

 

here is the code.

 

Dim L_USER As Object
Dim L_ITEM As ListViewItem
Dim L_COLLECTION As ListView.ListViewItemCollection = lstComputers.Items
Dim ERR_COUNT as integer
Dim ERR_COMPS() as String

For Each L_ITEM In L_COLLECTION
    Try
         L_USER = GetObject("WinNT://" & L_ITEM.Text & "/" &   txtLocalAccount.Text & ", user")
         L_USER.SetPassword(txtNewPassword.Text)
         prgTotalProgress.Increment(1)
    Catch ex As Exception
         ERR_COUNT += 1
         ERR_COMPS(ERR_COUNT) = L_ITEM.ToString
         prgTotalProgress.Increment(1)
    End Try
Next

 

The error happens when I try to add L_ITEM to the array. Anyone have any suggestions.

  • Administrators
Posted

You are not declaring the array size anywhere - hence it will not accept any entries. You will need to either decalre it with a size large enough to take all possible entries or investigate the redim command to see how to change the size of the array at runtime.

 

Also it usually helps to get a response if you give an indication of exactly what error you are getting rather than expecting people to guess.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...