Ejemplo n.º 1
0
        private string 提交数据(int gold, string type, int num)
        {
            string jiguo   = "";
            string token   = ViewState["token"].ToString();
            string user_id = ViewState["user_id"].ToString();

            if (token != "")
            {
                var m = new net_message();
                m.tag  = msg_tag.sys_system_pms;
                m.body = type + "|" + gold + "|" + num;
                List <net_message> s_list = client.Invoke <List <net_message> >("post", new object[] { user_id, token, m });


                foreach (var i in s_list)
                {
                    //string tag = i.tag;
                    if (i.tag == msg_tag.sys_admin)
                    {
                        jiguo = i.body;
                    }
                }
            }
            return(jiguo);
        }
Ejemplo n.º 2
0
        protected void btnLogin_Click(object sender, EventArgs e)
        {
            string uName = txtName.Text.Trim();
            string pass  = userMd5(txtPasss.Text.Trim());

            //client0.SendTimeout = 2000;
            client0.Timeout = 2000;
            net_message user = null;

            try
            {
                user = client0.Invoke <net_message>("login", new object[] { uName, pass });

                string token = "";
                if (user.tag == msg_tag.sys_login)
                {
                    string[] body = user.body.Split('|');

                    switch (body[0])
                    {
                    case "0":
                        //登录失败(账号或密码有误)
                        lbllogin.Text = "账号或密码有误";
                        break;

                    case "1":
                        //成功
                        token = body[1];
                        string user_id = body[2];
                        lbllogin.Text        = "1";
                        ViewState["token"]   = token;
                        ViewState["user_id"] = user_id;

                        break;

                    case "2":
                        //网络错误
                        lbllogin.Text = "网络错误";
                        break;
                    }
                }
                else
                {
                }
            }
            catch (Exception ex)
            {
                lbllogin.Text = "登录超时";
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 发送系统邮件
        /// </summary>
        /// <param name="u_id"></param>
        /// <param name="body">发送对象|标题|内容|附件1|附件2|附件3|附件4|附件5|附件6|附件7|附件8|附件9|附件10</param>
        /// <returns>0:访问失败;1发送成功,2参数不能为空,3没有此玩家</returns>
        public string systemSendMail(string token, string user_id, string body)
        {
            string fh = "";

            if (token != "")
            {
                var m = new NetMessage();
                m.tag  = msg_tag.sys_system_pms;
                m.body = body;
                List <NetMessage> s_list = client.Invoke <List <NetMessage> >("post", new object[] { user_id, token, m });


                foreach (var i in s_list)
                {
                    //string tag = i.tag;
                    if (i.tag == msg_tag.sys_admin)
                    {
                        fh = i.body;
                    }
                }
            }
            return(fh);
        }
Ejemplo n.º 4
0
        static void Main(string[] args)
        {
            //HproseTcpClient client0 = new HproseTcpClient("tcp://gl.huwan.net.cn:8086/");
            //HproseTcpClient client = new HproseTcpClient("tcp://gl.huwan.net.cn:8083/");
            HproseTcpClient client0 = new HproseTcpClient("tcp://192.168.2.117:8082/");
            HproseTcpClient client = new HproseTcpClient("tcp://192.168.2.117:8083/");

            //使用管理员账号登录
            string sysName = "PlayerA";
            string sysPass = "******";

            string uName = sysName;
            string pass = userMd5(sysPass);

            client0.Timeout = 2000;
            NetMessage user = null;
            int is_login = 0;
            string token = "";
            string user_id = "";
            try
            {
                user = client0.Invoke<NetMessage>("login", new object[] { uName, pass });

                if (user.tag == msg_tag.sys_login)
                {
                    string[] body = user.body.Split('|');

                    switch (body[0])
                    {
                        case "0":
                            //登录失败(账号或密码有误)

                            is_login = 0;
                            break;
                        case "1":
                            //成功
                            token = body[1];
                            user_id = body[2];
                            is_login = 1;
                            break;

                        case "2":
                            //网络错误
                            is_login = 2;
                            break;
                    }

                }

            }
            catch (Exception ex)
            {
               is_login = 3;
               Console.WriteLine("登录失败(未知错误)"+ex);
               Console.ReadKey();
            }

            if(is_login == 0)
            {
                Console.WriteLine("登录失败(账号或密码有误)");
            }else if(is_login == 2)
            {
                Console.WriteLine("登录失败(网络错误)");
            }else if(is_login == 3)
            {
                Console.WriteLine("登录失败(未知错误)");
            }else if(is_login == 1)
            {

                pvpdbDataContext DB = new pvpdbDataContext();

                var pvprank = from r in DB.t_pvp_rankingList  orderby r.rangking select r;
                foreach(var i in pvprank)
                {

                    sendgift(i.rangking,i.user_id,token,user_id);
                }
            }
        }
Ejemplo n.º 5
0
        static void Main(string[] args)
        {
            //HproseTcpClient client0 = new HproseTcpClient("tcp://gl.huwan.net.cn:8086/");
            //HproseTcpClient client = new HproseTcpClient("tcp://gl.huwan.net.cn:8083/");
            HproseTcpClient client0 = new HproseTcpClient("tcp://192.168.2.117:8082/");
            HproseTcpClient client  = new HproseTcpClient("tcp://192.168.2.117:8083/");

            //使用管理员账号登录
            string sysName = "PlayerA";
            string sysPass = "******";


            string uName = sysName;
            string pass  = userMd5(sysPass);

            client0.Timeout = 2000;
            NetMessage user     = null;
            int        is_login = 0;
            string     token    = "";
            string     user_id  = "";

            try
            {
                user = client0.Invoke <NetMessage>("login", new object[] { uName, pass });


                if (user.tag == msg_tag.sys_login)
                {
                    string[] body = user.body.Split('|');

                    switch (body[0])
                    {
                    case "0":
                        //登录失败(账号或密码有误)

                        is_login = 0;
                        break;

                    case "1":
                        //成功
                        token    = body[1];
                        user_id  = body[2];
                        is_login = 1;
                        break;

                    case "2":
                        //网络错误
                        is_login = 2;
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                is_login = 3;
                Console.WriteLine("登录失败(未知错误)" + ex);
                Console.ReadKey();
            }

            if (is_login == 0)
            {
                Console.WriteLine("登录失败(账号或密码有误)");
            }
            else if (is_login == 2)
            {
                Console.WriteLine("登录失败(网络错误)");
            }
            else if (is_login == 3)
            {
                Console.WriteLine("登录失败(未知错误)");
            }
            else if (is_login == 1)
            {
                pvpdbDataContext DB = new pvpdbDataContext();

                var pvprank = from r in DB.t_pvp_rankingList orderby r.rangking select r;
                foreach (var i in pvprank)
                {
                    sendgift(i.rangking, i.user_id, token, user_id);
                }
            }
        }
Ejemplo n.º 6
0
 public string TL_LoginTrade()
 {
     return(Client.Invoke("DoWork2", new object[] { "TL_LoginTrade", "" }) as string);
 }