我有以下对象:
public partial class Game
{
public bool Finished { get; set; }
public Guid GameGUID { get; set; }
public long GameID { get; set; }
public bool GameSetup { get; set; }
public Nullable<int> MaximumCardsInDeck { get; set; }
public Player Player { get; set; }
public Player Player1 { get; set; }
public bool Player1Connected { get; set; }
public bool Player1EnvironmentSetup { get; set; }
public long Player1ID { get; set; }
public int Player1Won { …Run Code Online (Sandbox Code Playgroud) 如何在Windows Phone 7中使用BinaryFormatter.
我using System.Runtime.Serialization.Formatters.Binary在service1.svc.cs中使用它,但我不能在windows phone 7中使用此Reference.
这有什么解决方案吗?
我的DeserializeObject代码
public static T DeserializeObject<T>(byte[] xml)
{
BinaryFormatter xs = new BinaryFormatter();
MemoryStream memoryStream = new MemoryStream(xml);
return (T)xs.Deserialize(memoryStream);
}
Run Code Online (Sandbox Code Playgroud)
BinaryFormatter在Windows Phone 7中出错.那么我该怎样才能反序列化.我在这段代码中要做些什么改变?