Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/azure/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# asp.net/ews会议请求获取与会者_C#_Asp.net_Exchangewebservices - Fatal编程技术网

C# asp.net/ews会议请求获取与会者

C# asp.net/ews会议请求获取与会者,c#,asp.net,exchangewebservices,C#,Asp.net,Exchangewebservices,我试图通过asp.net应用程序发送会议请求,然后检查与会者是否接受 我使用的第一种方法:“发送会议请求” 发送部分工作正常,我在outlook中收到一个会议请求,我可以在其中看到所需的与会者 现在,我来介绍获取所需与会者及其状态的方法: private void checkMeetings() { string[] split = User.Identity.Name.Split('\\'); string userTag = split[1

我试图通过asp.net应用程序发送会议请求,然后检查与会者是否接受

我使用的第一种方法:“发送会议请求”

发送部分工作正常,我在outlook中收到一个会议请求,我可以在其中看到所需的与会者

现在,我来介绍获取所需与会者及其状态的方法:

    private void checkMeetings()
    {

        string[] split = User.Identity.Name.Split('\\');

        string userTag = split[1];

        Active_Directory ad = new Active_Directory();

        string creator = ad.convertForUserInfo(userTag, "email");

        ExchangeService service = new ExchangeService();
        service.AutodiscoverUrl(creator);

        CalendarFolder folder = CalendarFolder.Bind(service, WellKnownFolderName.Calendar);

        CalendarView view = new CalendarView(Convert.ToDateTime("03.08.2015 08:00"),Convert.ToDateTime("08.08.2015 08:00"));

        FindItemsResults<Appointment> results = folder.FindAppointments(view);

        foreach (Appointment appointment in results)
        {

            var attendees = appointment.RequiredAttendees;

            Test1.Text += appointment.RequiredAttendees.Count() + "***";

            foreach (var attend in appointment.RequiredAttendees)
            {

                Test2.Text += attend.Name + " " + attend.ResponseType + "***";

            }

            //Test2.Text += appointment.Subject + "***";

        }
    }
private void checkMeetings()
{
string[]split=User.Identity.Name.split('\\');
字符串userTag=split[1];
Active_目录ad=新的Active_目录();
string creator=ad.convertForUserInfo(userTag,“email”);
ExchangeService服务=新的ExchangeService();
服务。自动发现URL(创建者);
CalendarFolder=CalendarFolder.Bind(服务,WellKnownFolderName.Calendar);
CalendarView视图=新日历视图(Convert.ToDateTime(“03.08.2015 08:00”)、Convert.ToDateTime(“08.08.2015 08:00”);
FindItemsResults=folder.FindAppoints(视图);
foreach(结果中的任命)
{
var Attendes=约会。RequiredAttendes;
Test1.Text+=appointment.requiredAttenders.Count()+“***”;
foreach(var预约出席。要求出席者)
{
Test2.Text+=attribute.Name+“”+attribute.ResponseType+“***”;
}
//Test2.Text+=appointment.Subject+“***”;
}
}
我现在的问题是,“appointment.requiredAttendes.count()”为0,即使我在发送会议请求时添加了一名与会者


有人知道为什么吗?或者有没有一个更简单的解决方案,我到目前为止还没有找到?

好的,我找到了自己问题的解决方案,如果有人遇到同样的问题,我会发布它

    private void checkMeetings()
    {

        string[] split = User.Identity.Name.Split('\\');

        string userTag = split[1];

        Active_Directory ad = new Active_Directory();

        string creator = ad.convertForUserInfo(userTag, "email");

        ExchangeService service = new ExchangeService();
        service.AutodiscoverUrl(creator);

        CalendarFolder folder = CalendarFolder.Bind(service, WellKnownFolderName.Calendar);

        CalendarView view = new CalendarView(Convert.ToDateTime("03.08.2015 08:00"),Convert.ToDateTime("08.08.2015 08:00"));

        FindItemsResults<Appointment> results = folder.FindAppointments(view);

        foreach (Appointment appointment in results)
        {

            Appointment appointmentDetailed = Appointment.Bind(service, appointment.Id, new PropertySet(BasePropertySet.FirstClassProperties) { RequestedBodyType = BodyType.Text });

            foreach (Attendee attendee in appointmentDetailed.RequiredAttendees)
            {
                Test2.Text += attendee.Name + " " + attendee.ResponseType + "***";
            }

        }
    }
private void checkMeetings()
{
string[]split=User.Identity.Name.split('\\');
字符串userTag=split[1];
Active_目录ad=新的Active_目录();
string creator=ad.convertForUserInfo(userTag,“email”);
ExchangeService服务=新的ExchangeService();
服务。自动发现URL(创建者);
CalendarFolder=CalendarFolder.Bind(服务,WellKnownFolderName.Calendar);
CalendarView视图=新日历视图(Convert.ToDateTime(“03.08.2015 08:00”)、Convert.ToDateTime(“08.08.2015 08:00”);
FindItemsResults=folder.FindAppoints(视图);
foreach(结果中的任命)
{
AppointAppointDetailed=Appointment.Bind(服务,Appointment.Id,新属性集(BasePropertySet.FirstClassProperties){RequestedBodyType=BodyType.Text});
foreach(指定的与会者详细说明。要求的与会者)
{
Test2.Text+=attendee.Name+“”+attendee.ResponseType+“***”;
}
}
}
固定它的部分是:

AppointAppointDetailed=Appointment.Bind(服务,Appointment.Id,新属性集(BasePropertySet.FirstClassProperties){RequestedBodyType=BodyType.Text})


现在我可以得到每一个atendee,看看他们是否接受了它

好的,我找到了我自己问题的解决方案,如果有人遇到同样的问题,我会发布它

    private void checkMeetings()
    {

        string[] split = User.Identity.Name.Split('\\');

        string userTag = split[1];

        Active_Directory ad = new Active_Directory();

        string creator = ad.convertForUserInfo(userTag, "email");

        ExchangeService service = new ExchangeService();
        service.AutodiscoverUrl(creator);

        CalendarFolder folder = CalendarFolder.Bind(service, WellKnownFolderName.Calendar);

        CalendarView view = new CalendarView(Convert.ToDateTime("03.08.2015 08:00"),Convert.ToDateTime("08.08.2015 08:00"));

        FindItemsResults<Appointment> results = folder.FindAppointments(view);

        foreach (Appointment appointment in results)
        {

            Appointment appointmentDetailed = Appointment.Bind(service, appointment.Id, new PropertySet(BasePropertySet.FirstClassProperties) { RequestedBodyType = BodyType.Text });

            foreach (Attendee attendee in appointmentDetailed.RequiredAttendees)
            {
                Test2.Text += attendee.Name + " " + attendee.ResponseType + "***";
            }

        }
    }
private void checkMeetings()
{
string[]split=User.Identity.Name.split('\\');
字符串userTag=split[1];
Active_目录ad=新的Active_目录();
string creator=ad.convertForUserInfo(userTag,“email”);
ExchangeService服务=新的ExchangeService();
服务。自动发现URL(创建者);
CalendarFolder=CalendarFolder.Bind(服务,WellKnownFolderName.Calendar);
CalendarView视图=新日历视图(Convert.ToDateTime(“03.08.2015 08:00”)、Convert.ToDateTime(“08.08.2015 08:00”);
FindItemsResults=folder.FindAppoints(视图);
foreach(结果中的任命)
{
AppointAppointDetailed=Appointment.Bind(服务,Appointment.Id,新属性集(BasePropertySet.FirstClassProperties){RequestedBodyType=BodyType.Text});
foreach(指定的与会者详细说明。要求的与会者)
{
Test2.Text+=attendee.Name+“”+attendee.ResponseType+“***”;
}
}
}
固定它的部分是:

AppointAppointDetailed=Appointment.Bind(服务,Appointment.Id,新属性集(BasePropertySet.FirstClassProperties){RequestedBodyType=BodyType.Text})


现在我可以获取每个atendee,看看他们是否接受它

加载其他属性的更好方法如下:

private void checkMeetings()
{

    string[] split = User.Identity.Name.Split('\\');

    string userTag = split[1];

    Active_Directory ad = new Active_Directory();

    string creator = ad.convertForUserInfo(userTag, "email");

    ExchangeService service = new ExchangeService();
    service.AutodiscoverUrl(creator);

    CalendarFolder folder = CalendarFolder.Bind(service, WellKnownFolderName.Calendar);

    CalendarView view = new CalendarView(Convert.ToDateTime("03.08.2015 08:00"),Convert.ToDateTime("08.08.2015 08:00"));

    FindItemsResults<Appointment> results = folder.FindAppointments(view);
    service.LoadPropertiesForItems(appointments, new PropertySet(BasePropertySet.IdOnly, AppointmentSchema.Subject, AppointmentSchema.Start, AppointmentSchema.RequiredAttendees));

    foreach (Appointment appointment in results)
    {

        foreach (Attendee attendee in appointment.RequiredAttendees)
        {
            Test2.Text += attendee.Name + " " + attendee.ResponseType + "***";
        }

    }
}

加载其他属性的更好方法如下所示:

private void checkMeetings()
{

    string[] split = User.Identity.Name.Split('\\');

    string userTag = split[1];

    Active_Directory ad = new Active_Directory();

    string creator = ad.convertForUserInfo(userTag, "email");

    ExchangeService service = new ExchangeService();
    service.AutodiscoverUrl(creator);

    CalendarFolder folder = CalendarFolder.Bind(service, WellKnownFolderName.Calendar);

    CalendarView view = new CalendarView(Convert.ToDateTime("03.08.2015 08:00"),Convert.ToDateTime("08.08.2015 08:00"));

    FindItemsResults<Appointment> results = folder.FindAppointments(view);
    service.LoadPropertiesForItems(appointments, new PropertySet(BasePropertySet.IdOnly, AppointmentSchema.Subject, AppointmentSchema.Start, AppointmentSchema.RequiredAttendees));

    foreach (Appointment appointment in results)
    {

        foreach (Attendee attendee in appointment.RequiredAttendees)
        {
            Test2.Text += attendee.Name + " " + attendee.ResponseType + "***";
        }

    }
}

sry,我忘了说我是这类东西的新手(asp.net),你说的“会话”是什么意思?会话在asp中保存数据以防止页面返回时数据丢失请在会议中尝试此先生测试\u单击按钮上的添加此代码
会话[“约会”]=会议
和在checkmeeting方法中调用并设置会话的值,如下所示
会议=(约会)会话[“约会”]但是我也是ASP.net的新手,我希望你能理解…我尝试了另一个解决方案,它成功了,我将把它发布在这里!但是谢谢你的回答,我忘了说我是这类东西的新手(asp.net),你说的“会话”是什么意思?会话在你的asp中保存数据以防止页面返回时数据丢失在你的会议中尝试此先生在你的会议中测试\u单击按钮上的添加此代码
会话[“约会”]=会议
和在checkmeeting方法中调用并设置会话的值,如下所示
会议=(约会)会话[“约会”]但是我也是ASP.net的新手,我希望你能理解…我尝试了另一个解决方案,它成功了,我将把它发布在这里!但是谢谢你的回答