Determine disabled status

J

James

vb.net 2003

i read the msdn documentation on Const ADS_UF_ACCOUNTDISABLE = &H2

how do i use the above to determine whether my account is disabled ? The
following does not work.

select case userAccountControl
case ADS_UF_ACCOUNTDISABLE
console.write ("account is disable")
etc etc et
end
 
L

Larry Lard

James said:
vb.net 2003

i read the msdn documentation on Const ADS_UF_ACCOUNTDISABLE = &H2

how do i use the above to determine whether my account is disabled ? The
following does not work.

select case userAccountControl
case ADS_UF_ACCOUNTDISABLE
console.write ("account is disable")
etc etc et
end

The docs indicate that this value is one member of a *flags* type enum,
so each value is a bitflag. Try

If (userAccountControl And ADS_UF_ACCOUNTDISABLE) =
ADS_UF_ACCOUNTDISABLE Then
'account is disabled
End If

(for example, 2, 42, 166, 1048578 are all possible values of
userAccountControl that have this flag set, so testing for equality
won't always work)
 
A

Armin Zingler

James said:
vb.net 2003

i read the msdn documentation on Const ADS_UF_ACCOUNTDISABLE = &H2

how do i use the above to determine whether my account is disabled ?
The following does not work.

select case userAccountControl
case ADS_UF_ACCOUNTDISABLE
console.write ("account is disable")
etc etc et
end

You found it in the MSDN documentation. If you use it's search function (for
ADS_UF_ACCOUNTDISABLE), I get 7 search results. There's also an example in
VB(6). That's what I would read first.

Armin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top