문제

Hi I am trying to display all non sensitive appointments in EWS (I can get all appointments fine, but even with restricted permissions I can still see private appointments which I shouldn't be able to see!)

This is basically what I want to do:

       if ( appointment.Sensitivity  == "Normal")

    Console.WriteLine(appointment.Subject);
}

However I get operator '==' cannot be applied to operands of type 'Microsoft.Exchange.WebServices.Data.Sensitivity' and 'String'

Can someone please advise?

도움이 되었습니까?

해결책

Compare it to the enum Microsoft.Exchange.WebServices.Data.Sensitivity rather than using ToString()

string message = appointment.Subject + " - " + appointment.Sensitivity;

if (appointment.Sensitivity == Sensitivity.Normal)
    Console.WriteLine(message);

다른 팁

string message = appointment.Subject + " - " + appointment.Sensitivity;

if (appointment.Sensitivity.ToString() == "Normal")
    Console.WriteLine(message);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top