예제 #1
0
        public static User_data unpack_UserData(string user_data)
        {
            User_data rec    = new User_data();
            string    st_php = "a" + user_data.Substring(14);

            PHPSerializationLibrary.Serializer serializer = new PHPSerializationLibrary.Serializer();
            Hashtable php = (Hashtable)serializer.Deserialize(st_php);

            rec.name     = (string)php["name"];
            rec.username = (string)php["username"];
            rec.email    = (string)php["email"];
            Hashtable fields = (Hashtable)php["fields"];

            rec.adresse  = (string)fields["adresse"];
            rec.postnr   = (string)fields["postnr"];
            rec.bynavn   = (string)fields["bynavn"];
            rec.mobil    = (string)fields["mobil"];
            rec.memberid = (string)fields["memberid"];
            rec.kon      = (string)((ArrayList)((Hashtable)php["membership_fields"])["kon"])[0];
            rec.fodtaar  = (string)((ArrayList)((Hashtable)php["membership_fields"])["fodtaar"])[0];
            rec.message  = (string)((Hashtable)php["membership_fields"])["message"];
            rec.fiknr    = (string)((Hashtable)php["membership_fields"])["fiknr"];
            rec.password = (string)php["password"];

            return(rec);
        }
예제 #2
0
        public static ecpwt_rsmembership_transactions_user_data unpack_UserData(int id, string user_data, string user_email)
        {
            ecpwt_rsmembership_transactions_user_data rec = new ecpwt_rsmembership_transactions_user_data();

            rec.id = id;
            string st_php = "a" + user_data.Substring(14);

            PHPSerializationLibrary.Serializer serializer = new PHPSerializationLibrary.Serializer();
            Hashtable php = (Hashtable)serializer.Deserialize(st_php);

            rec.name = (string)php["name"];
            if (rec.name == null)
            {
                rec.name = "";
            }

            rec.email = (string)php["email"];
            if (String.IsNullOrEmpty(rec.email))
            {
                rec.email = user_email;
            }
            if (rec.email == null)
            {
                rec.email = "";
            }

            Hashtable fields = (Hashtable)php["fields"];

            rec.adresse = (string)fields["adresse"];
            if (rec.adresse == null)
            {
                rec.adresse = "";
            }

            rec.postnr = (string)fields["postnr"];
            if (rec.postnr == null)
            {
                rec.postnr = "";
            }

            rec.bynavn = (string)fields["bynavn"];
            if (rec.bynavn == null)
            {
                rec.bynavn = "";
            }

            rec.mobil = (string)fields["mobil"];
            if (rec.mobil == null)
            {
                rec.mobil = "";
            }

            rec.memberid = (string)fields["memberid"];
            if (String.IsNullOrEmpty(rec.memberid))
            {
                rec.memberid = "";
            }

            rec.kon = (string)((ArrayList)((Hashtable)php["membership_fields"])["kon"])[0];
            if (rec.kon == null)
            {
                rec.kon = "";
            }

            rec.fodtaar = (string)((ArrayList)((Hashtable)php["membership_fields"])["fodtaar"])[0];
            if (rec.fodtaar == null)
            {
                rec.fodtaar = "";
            }

            return(rec);
        }