コード例 #1
0
        public static List <AppPackage> GetPackList(Panel panel)
        {
            XmlDocument xmlDom    = new XmlDocument();
            string      xmlString = EnvInfo.HttpGet(api + "package");

            xmlDom.LoadXml(xmlString);
            XmlNode           node     = xmlDom.ChildNodes[1].ChildNodes[2];
            List <AppPackage> tempList = new List <AppPackage>();

            for (int i = 0; i < node.ChildNodes.Count; i++)
            {
                string          packName = node.ChildNodes[i].SelectSingleNode("title").InnerText;
                string          ids      = node.ChildNodes[i].SelectSingleNode("description").InnerText;
                List <ImageApp> apps     = API.GetAppList(1, ids);
                AppPackage      pack     = new AppPackage(packName, apps, panel);
                pack.Location = new Point(10 + i * 180, 9);
                tempList.Add(pack);
            }
            return(tempList);
        }
コード例 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            string      userName  = textBox1.Text;
            string      password  = textBox2.Text;
            string      xmlString = EnvInfo.HttpGet(string.Format(api, userName, password));
            XmlDocument xmlDom    = new XmlDocument();

            xmlDom.LoadXml(xmlString);
            XmlNode node = xmlDom.ChildNodes[1].ChildNodes[2];

            if (node.SelectSingleNode("code").InnerText != "0")
            {
                MessageBox.Show(node.SelectSingleNode("message").InnerText);
            }
            else
            {
                new Form1(new UserInfo {
                    ID = node.SelectSingleNode("uid").InnerText, NickName = userName
                }).Show();
                this.Hide();
            }
        }
コード例 #3
0
        public static List <ImageApp> GetAppList(int type = 1, string ids = "")
        {
            string      ext       = type == 1 ? ".apk" : ".ipa";
            XmlDocument xmlDom    = new XmlDocument();
            string      xmlString = EnvInfo.HttpGet(api + "app/platform/" + type + "/ids/" + ids.Replace(',', '-'));

            xmlDom.LoadXml(xmlString);
            XmlNode         node     = xmlDom.ChildNodes[1].ChildNodes[2];
            List <ImageApp> tempList = new List <ImageApp>();

            for (int i = 0; i < node.ChildNodes.Count; i++)
            {
                string   appId         = node.ChildNodes[i].SelectSingleNode("cid").InnerText;
                string   appName       = node.ChildNodes[i].SelectSingleNode("title").InnerText;
                string   appPath       = appDir + appId + ext;
                string   appUrlPath    = uploads + node.ChildNodes[i].SelectSingleNode("down_link").InnerText;
                string   appImgPath    = appDir + appId + ".jpg";
                string   appImgUrlPath = uploads + node.ChildNodes[i].SelectSingleNode("thumb").InnerText;
                ImageApp app           = new ImageApp(appId, appName, appPath, appUrlPath, appImgPath, appImgUrlPath);
                app.Location = new Point(10 + i * 80, 10);
                tempList.Add(app);
            }
            return(tempList);
        }
コード例 #4
0
 public static void Install(string uid, string username, string aid, string deviceid)
 {
     EnvInfo.HttpGet(api + "install/?uid=" + uid + "&aid=" + aid + "&username="******"&deviceid=" + deviceid);
 }