Пример #1
0
        public bool fromJSON(string jsonstr)
        {
            JavaScriptSerializer serializer = new JavaScriptSerializer();

            TrialRegistration result = null;

            try
            {
                object resultobj = serializer.Deserialize(jsonstr, this.GetType());
                if (resultobj is TrialRegistration)
                {
                    result = resultobj as TrialRegistration;
                }
            }
            catch (Exception ex)
            {
                result = null;
            }

            if (result != null)
            {
                this.registrationid    = result.registrationid;
                this.processorid       = result.processorid;
                this.harddriveid       = result.harddriveid;
                this.macaddress        = result.macaddress;
                this.registrationip    = result.registrationip;
                this.registrationstate = result.registrationstate;
                this.registrationtime  = result.registrationtime;
            }

            return(false);
        }
Пример #2
0
        static TrialRegistration getComputerTrialRegistration()
        {
            TrialRegistration result = new TrialRegistration();

            return(result);
        }