예제 #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);
            }
        }
예제 #2
0
파일: OAuth.cs 프로젝트: pczy/Pub.Class
 /// <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();
 }
예제 #3
0
파일: OAuth.cs 프로젝트: pczy/Pub.Class
 /// <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();
 }
예제 #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());
        }
예제 #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());
        }
예제 #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));
        }
예제 #7
0
파일: OAuth.cs 프로젝트: pczy/Pub.Class
 /// <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);
 }
예제 #8
0
파일: OAuth.cs 프로젝트: pczy/Pub.Class
 /// <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);
 }