开发者

Escape reserve characters when searching for OU by name

I have written a search utility to search for AD objects. It is working perfectly.

the problem arises when any OU name have a reserve character in its name for example ','

and before searching I use 开发者_如何学JAVAto replace ',' with '\,' and it works fine.

but I check only for ',' not for other reserve characters.

Is there any way that I can escape those characters also, before searching?

Thanks


You can try using "@" to escape special characters. Example:

string strSpecialChar = @"this,is'with&special?chars";


You can escape all these by prefixing with a "\".

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜