Exemplo n.º 1
0
        private void checkAppStore(string bundleId)
        {
            updateProcessLog("Checking appstore...");

            this.cmdResult.activeurlapp = "";
            DateTime now9 = DateTime.Now;

            while (this.cmdResult.activeurlapp == "")
            {
                this.cmd.getactiveurl();
                Thread.Sleep(1000);
                if ((DateTime.Now - now9).TotalSeconds > 20.0)
                {
                    throw new TimeoutException("Get active Url timeouted");
                }
            }

            appInfo currAppInfo = Utils.getBundleIdentityByURL(this.cmdResult.activeurlapp);

            if (currAppInfo.bundleId == "")
            {
                ipData ipdata = NetworkHelper.getIPData(NetworkHelper.currentFakeIP);
                currAppInfo = Utils.getBundleIdentityByURL(this.cmdResult.activeurlapp, ipdata.countryCode);
            }

            if (currAppInfo.bundleId != bundleId && currAppInfo.bundleId != "")
            {
                base.Invoke(new MethodInvoker(delegate
                {
                    MessageBox.Show("Invalid application, please check offer link");
                    throw new Exception("Invalid application");
                }));
            }
        }
Exemplo n.º 2
0
        public static appInfo getBundleIdentityByURL(string URL, string region = null)
        {
            appInfo result = new appInfo();

            try
            {
                URL = URL.Replace("itms-appss", "https");
                URL = URL.Replace("itms-apps", "https");
                Match match = new Regex("/id([0-9]+)").Match(URL);
                if (match.Success)
                {
                    string ituneAppId = match.Groups[1].Value;
                    string requestURL = "https://itunes.apple.com/" + (region != null ? region : "") + "/lookup?id=" + ituneAppId;
                    string input      = new StreamReader(((HttpWebRequest)WebRequest.Create(requestURL)).GetResponse().GetResponseStream()).ReadToEnd();
                    Match  match2     = new Regex("\"bundleId\":\"(.*?)\"").Match(input);
                    Match  nameMatch  = new Regex("\"trackCensoredName\":\"(.*?)\"").Match(input);
                    if (match2.Success && nameMatch.Success)
                    {
                        result.bundleId = match2.Groups[1].Value;
                        result.name     = nameMatch.Groups[1].Value;
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("getBundleIdentityByURL exception: " + ex.Message);
            }

            return(result);
        }
        public bool insertApp(appInfo app)
        {
            if (this.openConn() == true)
            {
                using (MySqlCommand dbCMD = new MySqlCommand())
                {
                    dbCMD.Connection = this.sqlConn;

                    //For inserting appointments

                    if (app.tuteeID != null)
                    {
                        dbCMD.CommandText = $"INSERT INTO `appointmentLog`(`userID`, `studentID`, `appointmentDate`," +
                                            $" `subject`, `startTime`, `endTime`, `specialProgram`) " +
                                            $"VALUES({Convert.ToInt32(app.userID)}, {Convert.ToInt32(app.tuteeID)}, \"{app.appDate}\", \"{app.subject}\", \"{app.startTime}\", " +
                                            $"\"{app.endTime}\", \"{app.specPro}\")";
                    }
                    //For inserting embeded
                    else if (app.isEmbeded == true)
                    {
                        dbCMD.CommandText = $"INSERT INTO `appointmentLog`(`userID`, `appointmentDate`," +
                                            $" `subject`, `startTime`, `endTime`) " +
                                            $"VALUES({Convert.ToInt32(app.userID)}, \"{app.appDate}\", \"{app.subject} - Embeded\", \"{app.startTime}\", " +
                                            $"\"{app.endTime}\")";
                    }
                    //For inserting express
                    else
                    {
                        dbCMD.CommandText = $"INSERT INTO `appointmentLog`(`userID`, `appointmentDate`," +
                                            $" `subject`, `startTime`, `endTime`) " +
                                            $"VALUES({Convert.ToInt32(app.userID)}, \"{app.appDate}\", \"{app.subject}\", \"{app.startTime}\", " +
                                            $"\"{app.endTime}\")";
                    }

                    dbCMD.ExecuteNonQuery();
                }

                this.CloseConnect();
                return(true);
            }

            return(false);
        }
Exemplo n.º 4
0
 public IActionResult SignUp(appInfo signUp)
 {
     appTempStorage.AddApplication(signUp);
     return(View());
 }