Almaviva 2001~2008
January 10th, 2012 Phanix2011/10/22, @市長官邸沙龍
Read the rest of this entry / 繼續閱讀 »
2011/10/22, @市長官邸沙龍
Read the rest of this entry / 繼續閱讀 »
2011/12/30, 當天很忙,所以只有速記
未成年請勿飲酒,飲酒過量有礙身體健康
Read the rest of this entry / 繼續閱讀 »
2010/10/9
忘記是為什麼四五個人聚在一起吃飯喝酒,地點是令人緬懷的孔雀
未成年請勿飲酒,飲酒過量有礙身體健康
Read the rest of this entry / 繼續閱讀 »
Chateau Croizet Bages 2001
未成年請勿飲酒,飲酒過量有礙身體健康

Read the rest of this entry / 繼續閱讀 »
2011/12/19, @品集生活
燈光偏昏暗,外觀顏色部分或許不準確 / Light is not so good for a tasting event, so the appearance might be incorrect.
未成年請勿飲酒,飲酒過量有礙身體健康
Read the rest of this entry / 繼續閱讀 »
利用 tcp client connection 或 socket connection 來跟 Maya 溝通
Read the rest of this entry / 繼續閱讀 »
一般狀況下,如果不是很在意使用 XMLWriter 後輸出的文字編碼是哪一種的話,可以很簡單地用下面的方式完成
StringBuilder sb = new StringBuilder();
XmlWriter writer = XmlWriter.Create(sb);writer.WriteStartDocument();
//補上 xml 內容, 用 writer.WriteStartElement() 等完成
writer.WriteEndDocument();writer.Flush();
XmlDocument xmlDocument = new XmlDocument();
xmlDocument.LoadXml(sb.ToString());
但是可以發現到這樣子所輸出的 XML 文件是變成 UTF-16 encoding。雖然有 XmlWriterSettings 這東西可以去設定 XMLWriter 的編碼,不過看起來好像是有些問題,輸出的 XML 結果依舊是 UTF-16。
解決的方法是用 MemoryStream 與 XMLTextWriter。
MemoryStream stream = new MemoryStream();
XmlWriter writer = new XmlTextWriter(stream, Encoding.UTF8);writer.WriteStartDocument();
//補上 xml 內容, 用 writer.WriteStartElement() 等完成
writer.WriteEndDocument();writer.Flush();
StreamReader reader = new StreamReader(stream, Encoding.UTF8, true);
stream.Seek(0, SeekOrigin.Begin);
string result = reader.ReadToEnd();XmlDocument xmlDocument = new XmlDocument();
xmlDocument.LoadXml(result);
強者還是個正妹 XD
Read the rest of this entry / 繼續閱讀 »
吃好撐… =___=

Read the rest of this entry / 繼續閱讀 »