요약 : 응용 프로그램에서 ExchangeServiceBinding
명령을 수락하지 않습니다.ExchangeServiceBinding 네임 스페이스 오류
세부 사항 :
나는 내가 200 개 이메일 덩어리로받은 편지함을 깰 인덱스를 사용하고, 매우 큰 사서함을 통해 루프를 시도하고있다. (아래 그림 참조) 내가 찾을 수있는 유일한 예는
"ExchangeServiceBinding"형식 또는 네임 스페이스 이름을 반환 유지를 찾을 수 없습니다 (당신은 using 지시문 또는 어셈블리 참조가?)
어떤 나는 그것을 사용하고 있기 때문에 나는 이상한 것을 발견한다 using Microsoft.Exchange.WebServices;
. 어떤 아이디어 나 도움을 주시면 대단히 감사하겠습니다. Windows 7 및 Visual Studio 2010을 실행 중이고 Exchange 2007 사서함에 액세스하려고합니다.
것들 나는 시도했다 :
- 는 스택 내 책상에 머리를 꽝 MSDN
- 을 검색 오버플로
- 를 검색하는 구글
- 을 검색
- 시행 착오
코드 :
// Create binding variable to be used for GetItemsFromInbox().
// Set up the binding with credentials and URL.
ExchangeServiceBinding binding = new ExchangeServiceBinding();
binding.Credentials = new NetworkCredential(dUser, dPassword, dDomain);
binding.Url = new Uri("https://" + ExchangeServerName + "/EWS/Exchange.asmx");
// Set up the binding for Exchange impersonation.
binding.ExchangeImpersonation = new ExchangeImpersonationType();
binding.ExchangeImpersonation.ConnectingSID = new ConnectingSIDType();
binding.ExchangeImpersonation.ConnectingSID.PrimarySmtpAddress = "mailboxnamehere”;
// Call GetItemsFromInbox()
int index = 0;
bool looping = true;
while (looping)
{
List<ItemType> items = GetItemsFromInbox(binding, index, 200, index);
if (items == null || items.count == 0)
{
looping = false;
break;
}
// Do your work here
}
프로젝트가 ews 어셈블리를 참조합니까? –
예. Microsoft.Exchange.WebServices를 사용합니다. using Microsoft.Exchange.WebServices.Data; using Microsoft.Exchange.WebServices.Autodiscover; – toosweetnitemare