I have an exception of kind DirectoryServicesCOMException
and I need to extract the data value from it's ExtendedErrorMessage
property.
Here is a sample test from the ExtendedErrorMessage
property:
8009030C: LdapErr: DSID-0C0904DC, comment: AcceptSecurityContext error, data 701, v1db1
I need 701
from the string.
Just for reference, I found these messages from SO: https://stackoverflow.com/a/15024909/481656
I have success by using LastIndexOf 'data' and the next ',' after LastIndexOf 'data' combo but looking for a cleaner solution.
Thanks.