我有下面的代碼通過一定的字符串搜索全局地址簿:當搜索全局地址列表,有沒有辦法做局部搜索,而不僅僅是一個「startsWith」
「CONF」
var esb = new ExchangeServiceBinding();
esb.Url = @"https://myurl.com/EWS/Exchange.asmx";
esb.Credentials = new NetworkCredential(_user,_pwd, _domain);
var rnType = new ResolveNamesType {ReturnFullContactData = true, UnresolvedEntry = "CONF"};
ResolveNamesResponseType response = esb.ResolveNames(rnType);
ArrayOfResponseMessagesType responses = resolveNamesResponse.ResponseMessages;
var responseMessage = responses.Items[0] as ResolveNamesResponseMessageType;
ResolutionType[] resolutions = responseMessage.ResolutionSet.Resolution;
的問題是,它似乎是在做一個「打頭」搜索,所以我有個名字叫:
「CONF-123」,它會顯示出來,但如果我有一個名爲「喬 - CONF 「那麼它不會。
我該怎麼辦部分字符串搜索在這條線
var rnType = new ResolveNamesType {ReturnFullContactData = true, UnresolvedEntry = "CONF-"};
我希望能有這樣的:
var rnType = new ResolveNamesType {ReturnFullContactData = true, UnresolvedEntry = "%CONF-%"};
,但似乎並沒有工作。
您正在尋找'CONF-',但聲明'JOE-CONF'沒有顯示在回報中。我不認爲它會認爲' - '是在'CONF'之後,如果你只是使用'CONF'而沒有' - '會發生什麼。 – Ilnetd
這是一個錯字。 。我已更新問題 – leora
您還在尋找解決方案嗎? – rsteward