예제 #1
0
    int getIntValueFromDecodedString(string decodedString)
    {
        string s   = DesSecurity.DesDecrypt(decodedString, DECODED_KEY);
        int    num = 0;

        int.TryParse(s, out num);
        return(num);
    }
예제 #2
0
 protected void BindDate()
 {
     M_PostConfig       = Post.GetConfig(PhyFilePath);
     this.txtEmail.Text = M_PostConfig.Email;
     //this.txtPassword.Text = M_PostConfig.Password;
     this.txtPassword.Attributes.Add("value", DesSecurity.DesDecrypt(M_PostConfig.Password, "emailpwd"));
     this.txtSmtpServer.Text = M_PostConfig.SmtpServer;
     this.txtPort.Text       = M_PostConfig.Port;
 }
예제 #3
0
        protected void BindDate()
        {
            M_PostConfig       = Post.GetConfig(PhyFilePath);
            this.txtEmail.Text = M_PostConfig.Email;
            //this.txtPassword.Text = M_PostConfig.Password;
            this.txtPassword.Attributes.Add("value", DesSecurity.DesDecrypt(M_PostConfig.Password, "emailpwd"));
            this.txtSmtpServer.Text = M_PostConfig.SmtpServer;
            this.txtPort.Text       = M_PostConfig.Port;

            string memberValue = Utils.XmlRead(hrFilePath, "HRConfig/IsMember", "");
            string mailValue   = Utils.XmlRead(hrFilePath, "HRConfig/IsSendToEmail", "");

            txtResumeDetailFilePath.Value = Utils.XmlRead(hrFilePath, "HRConfig/ResumeDetailFilePath", "");
            txtEMailTitle.Text            = Utils.XmlRead(hrFilePath, "HRConfig/EMailTitle", "").Replace("{SiteName}", siteName);
            txtEMailContent.Content       = Utils.XmlRead(hrFilePath, "HRConfig/EMailContent", "").Replace("{SiteName}", siteName);
            if (memberValue == "1")
            {
                chkIsMember.Checked = true;
            }
            if (mailValue == "1")
            {
                chkIsEmail.Checked = true;
            }
        }
    public IEnumerator send()
    {
        string jsonContent = _data.toJson();

        string encodedJson = jsonContent;

        if (_formKey == "data")
        {
            encodedJson = DesSecurity.DesEncrypt(jsonContent, encoded_key);
        }

        WWWForm form = new WWWForm();

        form.AddField("deviceId", getDeviceID());
        form.AddField("openId", getOpenID());
        form.AddField(_formKey, encodedJson);

        if (_formKey == "data" && _data != null && _data.ContainsKey("cmd"))
        {
            form.AddField("cmd", _data["cmd"].ToString());
        }
        else
        {
            form.AddField("cmd", "bi");
        }

        //form.AddField("debug", "1");
        form.AddField("auth", _authCode.ToString());

        int userID = getUserID();

        if (userID != -1)
        {
            form.AddField("userId", userID.ToString());
        }

        string serverUrl = _formKey == "data" ? AppSettings.gameServerUrl : AppSettings.biServerUrl;

        WWW getData = new WWW(serverUrl, form);

        yield return(getData);

        if (getData.error == null)
        {
            //string result = getData.text;
            string result = DesSecurity.DesDecrypt(getData.text, encoded_key);

            // Cache UID
            Dictionary <string, object> dataDict = result.dictionaryFromJson();
            if (dataDict != null && dataDict.ContainsKey("userId"))
            {
                int uid = Convert.ToInt32(dataDict["userId"]);
                Debug.Log("Cache User ID: " + uid.ToString());
                setUserID(uid);
            }

            // verify auth code
            bool verifyOK = true;
            if (dataDict.ContainsKey("auth"))
            {
                int returnAuthCode = Convert.ToInt32(dataDict["auth"]);
                if (returnAuthCode != _authCode)
                {
                    verifyOK = false;
                }
            }

            if (dataDict.ContainsKey("cheat"))
            {
                int cheat = Convert.ToInt32(dataDict["cheat"]);
                PlayerPrefs.SetInt("cheat", cheat);
            }

            if (verifyOK && _successDelegate != null && dataDict.ContainsKey("data"))
            {
                Dictionary <string, object> dict = dataDict["data"] as Dictionary <string, object>;
                _successDelegate(dict.toJson());
            }
            else if (!verifyOK && _failDelgate != null)
            {
                _failDelgate();
            }

            Destroy(this.gameObject);
        }
        else
        {
            if (_failDelgate != null)
            {
                _failDelgate();
            }
            Debug.Log(getData.error);

            Destroy(this.gameObject);
        }
    }