切换风格

默认Lavender Sky Flowers Wizard Snow Beige California City Dragon Black London Sunset glow Pink Cloud

3

主题

45

积分

0

精华

用户组 

易积分
538
热心
0
好评
0
C#如意验证平台对接(慢更中)[复制链接]
发表于 2020-4-20 13:41:37 | 显示全部楼层 |阅读模式
准备资源:VS2019 微软官网就能下载到,大家自己下载安装
                 如意网络验证1.71版 站内下载
2020-4-20
构建公用class类


using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;

namespace ruyi
{
    class RuYi
    {
        private string appkey;
        private string rc4key;
        private string api;
        private string sn;
        private string qqappid;

        private static string token;
        private static string userid;//用户ID
        private static string headportrait;//头像
        private static string nickname;//昵称
        private static string vip;//会员
        private static string integral;//积分
        private static string account;
        private static string username;//账号
        private static string email;//邮箱
        private static string mobeli;//手机号
        private static string signin;//签到
        private static string referrer;//推荐人
        private static string openid_qq;
        private static string openid_wx;

        private static MD5 md5 = MD5.Create();

        public RuYi(string _appkey,string _rc4key,string _api,string _sn,string _qqappid)
        {
            appkey = _appkey;
            rc4key = _rc4key;
            api = _api;
            sn = _sn;
            qqappid = _qqappid;
        }

        #region string转换到MD5
        private static string GetMD5HashString(Encoding encode,string sourceStr)
        {
            StringBuilder sb = new StringBuilder();
            byte[] source = md5.ComputeHash(encode.GetBytes(sourceStr));
            for(int i = 0; i < source.Length; i++)
            {
                sb.Append(source.ToString("x2"));
            }
            return sb.ToString();
        }
        #endregion

        #region 读取签名数据
        public string Autograph(string str)
        {
            return GetMD5HashString(Encoding.UTF8, str+"&"+appkey);
        }
        #endregion

        #region 设置或读取token
        public string Token
        {
            set{ token = value; }

            get { return token; }
        }
        #endregion

        #region 设置或读取用户ID
        public string Userid
        {
            set { userid = value; }

            get { return userid; }
        }
        #endregion

        #region 设置或读取头像
        public string Headportrait
        {
            set { headportrait = value; }

            get { return headportrait; }
        }
        #endregion

        #region 设置或读取昵称
        public string Nickname
        {
            set { nickname = value; }

            get { return nickname; }
        }
        #endregion

        #region 设置或读取会员
        public string Vip
        {
            set { vip = value; }

            get { return vip; }
        }
        #endregion

        #region 设置或读取积分
        public string Integral
        {
            set { integral = value; }

            get { return integral; }
        }
        #endregion

        #region 设置或读取account
        public string Account
        {
            set { account = value; }

            get { return account; }
        }
        #endregion

        #region 设置或读取账号
        public string Username
        {
            set { username = value; }

            get { return username; }
        }
        #endregion

        #region 设置或读取邮箱
        public string Email
        {
            set { email = value; }

            get { return email; }
        }
        #endregion

        #region 设置或读取手机号
        public string Mobeli
        {
            set { mobeli = value; }

            get { return mobeli; }
        }
        #endregion

        #region 设置或读取签到
        public string Signin
        {
            set { signin = value; }

            get { return signin; }
        }
        #endregion

        #region 设置或读取推荐人
        public string Referrer
        {
            set { referrer = value; }

            get { return referrer; }
        }
        #endregion

        #region 设置或读取openid_qq
        public string Openid_qq
        {
            set { openid_qq = value; }

            get { return openid_qq; }
        }
        #endregion

        #region 设置或读取openid_wx
        public string Openid_wx
        {
            set { openid_wx = value; }

            get { return openid_wx; }
        }
        #endregion

    }
}
后续再慢慢更新。。。。敬请期待!

易如意中文编程学习交流论坛有你更精彩~
回复

使用道具 举报

5

主题

221

积分

0

精华

用户组 

易积分
1089
热心
0
好评
0
QQ
发表于 2020-4-20 15:47:16 | 显示全部楼层
你是个板凳B,。。。。。。。。。。。。。
易如意中文编程学习交流论坛有你更精彩~
回复

使用道具 举报

3

主题

45

积分

0

精华

用户组 

易积分
538
热心
0
好评
0
发表于 2020-4-21 00:42:45 | 显示全部楼层
2020-4-21,完成部分功能
1、APP应用检测更新
2、增加登录窗口 微信截图_20200421004111.png

更新不易...请尊重成果,不要看完就走,记得回复下!
易如意中文编程学习交流论坛有你更精彩~
回复

使用道具 举报

8

主题

54

积分

0

精华

用户组 

易积分
75
热心
0
好评
0
发表于 2020-4-21 09:18:56 | 显示全部楼层
555555555555555555555555555555
易如意中文编程学习交流论坛有你更精彩~
回复

使用道具 举报

1

主题

17

积分

0

精华

用户组 

易积分
13
热心
0
好评
0
发表于 2020-4-21 23:39:55 来自手机 | 显示全部楼层
真厉害!!!
易如意中文编程学习交流论坛有你更精彩~
回复

使用道具 举报

0

主题

4

积分

0

精华

用户组 

易积分
4
热心
0
好评
0
发表于 2020-4-27 01:11:36 | 显示全部楼层
我看看啊
易如意中文编程学习交流论坛有你更精彩~
回复

使用道具 举报

0

主题

12

积分

0

精华

用户组 

易积分
77
热心
0
好评
0
发表于 2020-5-5 14:57:33 | 显示全部楼层
这个挺不错的
易如意中文编程学习交流论坛有你更精彩~
回复

使用道具 举报

0

主题

16

积分

0

精华

用户组 

易积分
22
热心
0
好评
0
发表于 2022-3-15 12:59:50 | 显示全部楼层
还是不错的 来学习了
易如意中文编程学习交流论坛有你更精彩~
回复

使用道具 举报

1

主题

57

积分

0

精华

用户组 

易积分
1010
热心
0
好评
0
发表于 2024-1-18 15:31:56 | 显示全部楼层
ѧϰ
易如意中文编程学习交流论坛有你更精彩~
回复

使用道具 举报

1

主题

57

积分

0

精华

用户组 

易积分
1010
热心
0
好评
0
发表于 2024-4-3 15:27:26 | 显示全部楼层
ѧϰ
易如意中文编程学习交流论坛有你更精彩~
回复

使用道具 举报

QQ|sitemap|免责声明|RGB颜色对照表|手机版|小黑屋| 易如意 - E4A中文编程学习交流论坛

GMT+8, 2024-5-3 14:17 , Processed in 0.058300 second(s), 36 queries .

Powered by Discuz! X3.4

© 2001-2018 eruyi.cn

返回顶部