Pages

Wednesday, December 18, 2013

Converting String to Stream

Most of us has faced at some point of time thinking how to convert a string to Stream object.

In fact its easy

string xmlString="<writeacode>Blogs</writeacode>";

Stream xmlStream= new MemoryStream(Encoding.UTF8.GetBytes(xmlString);

Thats it!

Thursday, January 10, 2013

Easy Tips for Loading Xml file added in Silverlight Application

Like me, I hope many Silverlight developers would have had difficulty to read Xml file added in Silverlight application. So I thought to be my first post in my blog.

Step 1. Change 'Build Action' of Xml file to 'Embedded Resource'. You can find this in Property pane (Right click Xml file and take Property)



Step 2. Code! :)

Note url string. {app_name}.{folder_name}.{file_name}

You wrote a working code in .net :)

Thanks for reading
VJ