วันพฤหัสบดีที่ 27 มกราคม พ.ศ. 2554

Remove Windows Live Contact from Windows Mobile 6

Once setup Windows live and use msn with email every email will combine with outlook contact.
- -'

So bad
For fix this go to Windows Live through "Program" and use menu Switch Account in Account Options
After a few Minute this will delete all setting for your msn and after EULA display just reject it.
Wow! anything clean again.

Thanks for this blog for help me a lot.

ref http://www.pctipguys.com/index.php?option=com_content&task=view&id=96&Itemid=36

วันพฤหัสบดีที่ 13 มกราคม พ.ศ. 2554

XmlTextWriter to format out xml with newline and indent.

This is sample from my project to serializer object with utf8.

XmlSerializer xmlFormat = new XmlSerializer( typeof( LeaveObjectItem ) );

string xml = String.Empty;

Encoding utf8EncodingWithNoByteOrderMark = new UTF8Encoding( false );
using (MemoryStream stream = new MemoryStream())
{
XmlTextWriter xtw = new XmlTextWriter( stream, utf8EncodingWithNoByteOrderMark );
xtw.Formatting = Formatting.Indented;
xtw.Indentation = 4;
xmlFormat.Serialize( xtw, ItemToExport );
xml = Encoding.UTF8.GetString( stream.ToArray() );
}

using (StreamWriter outfile =
new StreamWriter( fullpath, false, System.Text.Encoding.UTF8 ))
{
outfile.Write( xml.Replace( ">�<", ">DBNULL<" ) );
}