3.16.2010

.NET 4.0 Serializing IDictionary

Yes, now we can serializing the object which contain or implement of IDictionay in .NET 4.0.

The different part of code is change to using System.Xaml namespace and the code is more simple, for instance:

using (StreamWriter stream = newStreamWriter("C:\\data.xml")) {
    stream.Write(
XamlServices.Save(data));
}

Now the I have to reconsider the power of the web service…

 

現在我們可以在.NET4.0 的程式碼中Serializing(序列化)含有IDictionary或是繼承自他的物件.

差異的地方是我們必須引用System.Xaml, 新的序列化服務的寫法也變簡單了, 請參考下面程式碼:

using (StreamWriter stream = newStreamWriter("C:\\data.xml")) {
    stream.Write(
XamlServices.Save(data));
}

嘖嘖嘖..我現在要好好想想web service的威力了….

No comments: