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

前端 未结 6 624
囚心锁ツ
囚心锁ツ 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条回答
  •  一整个雨季
    2020-12-14 10:33

    Are you trying to prevent some sort of injection attack against your directory server via user input? If that is the case I would just validate the input with Regex before passing it to LDAP.

提交回复
热议问题