How to escape a string in C#, for use in an LDAP query

前端 未结 6 628
囚心锁ツ
囚心锁ツ 2020-12-14 10:00

I have an LDAP query, which I am using to perform a search in C#. It uses two string variables (username and domain) which need to be escaped for security reasons.

H

6条回答
  •  旧时难觅i
    2020-12-14 10:32

    Use PInvoke with DsQuoteRdnValueW. For code, see my answer to another question: https://stackoverflow.com/a/11091804/628981

提交回复
热议问题