Link to home
Create AccountLog in
Avatar of sirbounty
sirbountyFlag for United States of America

asked on

background worker

In one of my subs, I retrieve detail on a server share - depending on if it's a user's share or a departmental share.
QueryUser is a directory services search for the related information stored in active directory, giving me the target server and share information for the user or group.

strShare = QueryUser(txtShare.Text)
or
strShare = QueryGroup(txtShare.Text)

If the function doesn't work, it returns "Share not found" and my sub exits, since it's presumably an invalid share:
If strShare = "Share not found" Then Exit Sub

I'd like to be able to devise a process to allow the share to be queried in the background with a bgw, but am struggling a bit on how to accomplish that.
Can anyone assist?
                   
SOLUTION
Avatar of Jorge Paulino
Jorge Paulino
Flag of Portugal image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
ASKER CERTIFIED SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Hey emoreau nice blog and nice detailed articles!
Avatar of Orbixx
Orbixx

Private Sub Form1_Load

Dim otherthread as new System.Threading.Thread(AddressOf OtherSub)

Yournormalcode()
otherthread.Start()

End Sub


Private Sub OtherSub()
Othercode()
End Sub