Ejemplo n.º 1
0
        /// <summary>
        /// 同步消息
        /// </summary>
        /// <param name="authEnum">授权类型</param>
        /// <param name="accessToken">Access Token</param>
        /// <param name="accessSecret">Access Secret</param>
        /// <param name="text">消息</param>
        public static void SendText(OAuthEnum authEnum, string accessToken, string accessSecret, string text)
        {
            IOAuth auth = null;

            switch (authEnum)
            {
            case OAuthEnum.msn: auth = new MSNOAuth(); break;

            case OAuthEnum.sina: auth = new SinaOAuth(); break;

            case OAuthEnum.qq: auth = new QQOAuth(); break;

            case OAuthEnum.netease: auth = new NeteaseOAuth(); break;

            case OAuthEnum.sohu: auth = new SohuOAuth(); break;

            case OAuthEnum.kaixin: auth = new KaiXinOAuth(); break;

            case OAuthEnum.renren: auth = new RenRenOAuth(); break;
            }
            if (!auth.IsNull())
            {
                auth.SendText(accessToken, accessSecret, text);
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 取登录账号信息
 /// </summary>
 /// <param name="authEnum">授权类型</param>
 /// <returns>取登录账号信息</returns>
 public static UserInfo GetUserInfo(OAuthEnum authEnum) {
     IOAuth auth = null;
     switch (authEnum) {
         case OAuthEnum.msn: auth = new MSNOAuth(); break;
         case OAuthEnum.sina: auth = new SinaOAuth(); break;
         case OAuthEnum.qq: auth = new QQOAuth(); break;
         case OAuthEnum.netease: auth = new NeteaseOAuth(); break;
         case OAuthEnum.sohu: auth = new SohuOAuth(); break;
         case OAuthEnum.kaixin: auth = new KaiXinOAuth(); break;
         case OAuthEnum.renren: auth = new RenRenOAuth(); break;
     }
     return auth.IsNull() ? null : auth.GetUserInfo();
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 取登录URL
 /// </summary>
 /// <param name="authEnum">授权类型</param>
 /// <returns>登录URL</returns>
 public static string GetAuthUrl(OAuthEnum authEnum) {
     IOAuth auth = null;
     switch (authEnum) {
         case OAuthEnum.msn: auth = new MSNOAuth(); break;
         case OAuthEnum.sina: auth = new SinaOAuth(); break;
         case OAuthEnum.qq: auth = new QQOAuth(); break;
         case OAuthEnum.netease: auth = new NeteaseOAuth(); break;
         case OAuthEnum.sohu: auth = new SohuOAuth(); break;
         case OAuthEnum.kaixin: auth = new KaiXinOAuth(); break;
         case OAuthEnum.renren: auth = new RenRenOAuth(); break;
     }
     return auth.IsNull() ? string.Empty : auth.GetAuthUrl();
 }
Ejemplo n.º 4
0
        /// <summary>
        /// 取登录账号信息
        /// </summary>
        /// <param name="authEnum">授权类型</param>
        /// <returns>取登录账号信息</returns>
        public static UserInfo GetUserInfo(OAuthEnum authEnum)
        {
            IOAuth auth = null;

            switch (authEnum)
            {
            case OAuthEnum.msn: auth = new MSNOAuth(); break;

            case OAuthEnum.sina: auth = new SinaOAuth(); break;

            case OAuthEnum.qq: auth = new QQOAuth(); break;

            case OAuthEnum.netease: auth = new NeteaseOAuth(); break;

            case OAuthEnum.sohu: auth = new SohuOAuth(); break;

            case OAuthEnum.kaixin: auth = new KaiXinOAuth(); break;

            case OAuthEnum.renren: auth = new RenRenOAuth(); break;
            }
            return(auth.IsNull() ? null : auth.GetUserInfo());
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 取登录URL
        /// </summary>
        /// <param name="authEnum">授权类型</param>
        /// <returns>登录URL</returns>
        public static string GetAuthUrl(OAuthEnum authEnum)
        {
            IOAuth auth = null;

            switch (authEnum)
            {
            case OAuthEnum.msn: auth = new MSNOAuth(); break;

            case OAuthEnum.sina: auth = new SinaOAuth(); break;

            case OAuthEnum.qq: auth = new QQOAuth(); break;

            case OAuthEnum.netease: auth = new NeteaseOAuth(); break;

            case OAuthEnum.sohu: auth = new SohuOAuth(); break;

            case OAuthEnum.kaixin: auth = new KaiXinOAuth(); break;

            case OAuthEnum.renren: auth = new RenRenOAuth(); break;
            }
            return(auth.IsNull() ? string.Empty : auth.GetAuthUrl());
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 取登录账号好友信息
        /// </summary>
        /// <param name="authEnum">授权类型</param>
        /// <param name="accessToken">Access Token</param>
        /// <param name="accessSecret">Access Secret</param>
        /// <returns>取登录账号好友信息</returns>
        public static IList <UserInfo> GetFriendsInfo(OAuthEnum authEnum, string accessToken, string accessSecret)
        {
            IOAuth auth = null;

            switch (authEnum)
            {
            case OAuthEnum.msn: auth = new MSNOAuth(); break;

            case OAuthEnum.sina: auth = new SinaOAuth(); break;

            case OAuthEnum.qq: auth = new QQOAuth(); break;

            case OAuthEnum.netease: auth = new NeteaseOAuth(); break;

            case OAuthEnum.sohu: auth = new SohuOAuth(); break;

            case OAuthEnum.kaixin: auth = new KaiXinOAuth(); break;

            case OAuthEnum.renren: auth = new RenRenOAuth(); break;
            }
            return(auth.IsNull() ? null : auth.GetFriendsInfo(accessToken, accessSecret));
        }
Ejemplo n.º 7
0
 /// <summary>
 /// 取登录账号好友信息
 /// </summary>
 /// <param name="authEnum">授权类型</param>
 /// <param name="accessToken">Access Token</param>
 /// <param name="accessSecret">Access Secret</param>
 /// <returns>取登录账号好友信息</returns>
 public static IList<UserInfo> GetFriendsInfo(OAuthEnum authEnum, string accessToken, string accessSecret) {
     IOAuth auth = null;
     switch (authEnum) {
         case OAuthEnum.msn: auth = new MSNOAuth(); break;
         case OAuthEnum.sina: auth = new SinaOAuth(); break;
         case OAuthEnum.qq: auth = new QQOAuth(); break;
         case OAuthEnum.netease: auth = new NeteaseOAuth(); break;
         case OAuthEnum.sohu: auth = new SohuOAuth(); break;
         case OAuthEnum.kaixin: auth = new KaiXinOAuth(); break;
         case OAuthEnum.renren: auth = new RenRenOAuth(); break;
     }
     return auth.IsNull() ? null : auth.GetFriendsInfo(accessToken, accessSecret);
 }
Ejemplo n.º 8
0
 /// <summary>
 /// 同步消息
 /// </summary>
 /// <param name="authEnum">授权类型</param>
 /// <param name="accessToken">Access Token</param>
 /// <param name="accessSecret">Access Secret</param>
 /// <param name="text">消息</param>
 public static void SendText(OAuthEnum authEnum, string accessToken, string accessSecret, string text) { 
     IOAuth auth = null;
     switch (authEnum) {
         case OAuthEnum.msn: auth = new MSNOAuth(); break;
         case OAuthEnum.sina: auth = new SinaOAuth(); break;
         case OAuthEnum.qq: auth = new QQOAuth(); break;
         case OAuthEnum.netease: auth = new NeteaseOAuth(); break;
         case OAuthEnum.sohu: auth = new SohuOAuth(); break;
         case OAuthEnum.kaixin: auth = new KaiXinOAuth(); break;
         case OAuthEnum.renren: auth = new RenRenOAuth(); break;
     }
     if (!auth.IsNull()) auth.SendText(accessToken, accessSecret, text);
 }