当前位置: 首页>>代码示例>>C#>>正文


C# CalendarService.setUserCredentials方法代码示例

本文整理汇总了C#中CalendarService.setUserCredentials方法的典型用法代码示例。如果您正苦于以下问题:C# CalendarService.setUserCredentials方法的具体用法?C# CalendarService.setUserCredentials怎么用?C# CalendarService.setUserCredentials使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CalendarService的用法示例。


在下文中一共展示了CalendarService.setUserCredentials方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GAuthenticate

    private CalendarService GAuthenticate()
    {
        Uri oCalendarUri = new Uri("http://www.google.com/calendar/feeds/[email protected]/private/full");
        //Uri oCalendarUri = new Uri("http://www.google.com/calendar/feeds/[email protected]/private/full");
        //Initialize Calendar Service
        CalendarService oCalendarService = new CalendarService("CalendarSampleApp");
        oCalendarService.setUserCredentials(sGoogleUserName, sGooglePassword);

        //Use Proxy
        GDataRequestFactory oRequestFactory = (GDataRequestFactory)oCalendarService.RequestFactory;
        WebProxy oWebProxy = new WebProxy(WebRequest.DefaultWebProxy.GetProxy(oCalendarUri));
        oWebProxy.Credentials = CredentialCache.DefaultCredentials;
        oWebProxy.UseDefaultCredentials = true;
        oRequestFactory.Proxy = oWebProxy;

        return oCalendarService;
    }
开发者ID:pank1982,项目名称:mydoc,代码行数:17,代码来源:DoctorsList.aspx.cs

示例2: RefreshFeed

    private void RefreshFeed()
    {
        string calendarURI = "https://www.google.com/calendar/feeds/default/private/full";
        string userName = "Test";
        string passWord = "Test";

        this.entryList = new ArrayList();
        EventQuery query = new EventQuery();
        CalendarService service = new CalendarService("CalendarSampleApp");

        service.setUserCredentials(userName, passWord);

        // only get event's for today - 48 months until today + ½ year

        query.Uri = new Uri(calendarURI);

        query.StartTime = DateTime.Now.AddMonths(-48);
        query.EndTime = DateTime.Now.AddMonths(6);

        EventFeed calFeed = service.Query(query) as EventFeed;

        // now populate the calendar
        while (calFeed != null && calFeed.Entries.Count > 0)
        {
            // look for the one with dinner time...
            foreach (EventEntry entry in calFeed.Entries)
            {
                this.entryList.Add(entry);
            }
            // just query the same query again.
            if (calFeed.NextChunk != null)
            {
                query.Uri = new Uri(calFeed.NextChunk);
                calFeed = service.Query(query) as EventFeed;
            }
            else
                calFeed = null;
        }
    }
开发者ID:Woodje,项目名称:Database,代码行数:39,代码来源:Kalender.aspx.cs


注:本文中的CalendarService.setUserCredentials方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。