locked
关于windows phone 8base64反序列化的问题 RRS feed

  • 问题

  • string str = e.Result;
    
    MessageBox.Show(e.Result);
    
    MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(e.Result));
    DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(userList));
      userList list = (userList)serializer.ReadObject(ms);
                            



    然后到userList list = (userList)serializer.ReadObject(ms);就中断了

    另userlist类

    class userList : System.ComponentModel.INotifyPropertyChanged
        {
     
    		
    		string name;
    		public string Name
    		{
    			get
    			{
    				return name;
    			}
    		
    			set
    			{
    				if(value != name)
    				{
    					name= value;
    					NotifyPropertyChanged("Name");
    				}
    			}
    		}
    		
    
    	
    	    string photo;
            public string Photo
            {
                get
                {
                    return photo;
                }
                set
                {
                    if (value != photo)
                    {
                        photo = value;
                        NotifyPropertyChanged("Photo");
                    }
                }
            }
    		
    		
    		public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
    
            public void NotifyPropertyChanged(string propertyName)
            {
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
                }
            }
    		
    	
        }后来只保留了上面两个字段,求解怎样才能解决问题。。。不胜感激
    2014年3月12日 15:49

答案