static void Md5Sum()
        {
            string md5Hash = ReferralCore.GetMD5Hash("09e93cd6710c903f2f6a8071ea38bf8a6f0d552a");

            Console.WriteLine("md5 hash " + md5Hash);
            Console.ReadLine();
        }
Exemple #2
0
        public void ProcessRequest(HttpContext context)
        {
            string            msg             = "";
            TransactionStatus myStatus        = TransactionStatus.None;
            TransactionStatus ourFriendStatus = TransactionStatus.None;
            string            responseMsg     = "";
            int count = 0;

            try
            {
                string myCode = context.Request.QueryString["code"];

                if (!string.IsNullOrEmpty(myCode))
                {
                    IphonePackers.AppVerifier verifier = new IphonePackers.AppVerifier(true, false);

                    responseMsg += verifier.GetResponseString(Constants.DefaultAppId, myCode, "", false, out myStatus);

                    if (myStatus == TransactionStatus.Completed)
                    {//save it
                        string md5Hash = ReferralCore.GetMD5Hash(myCode);
                        md5Hash = md5Hash.ToUpper();

                        count = DatabaseAccessor.GetReferralCount(myCode, md5Hash);
                    }
                }
            }
            catch (Exception e)
            {
                msg = e.Message;
            }


            context.Response.Write(count);
            context.Response.StatusCode = 200;
            context.Response.Cache.SetCacheability(HttpCacheability.NoCache);
            context.Response.Cache.SetExpires(DateTime.UtcNow);
        }