コード例 #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);
 }