>私もShift-JISで書き込まれ、文字化けになったので、対処法を。(VS2012 for Desktop / .NET4.0 / Win8x64)
>Dim serializer As New >System.Xml.Serialization.XmlSerializer(GetType>(SampleClass)) >Dim fs As New System.IO.FileStream("aaa.txt", >System.IO.FileMode.Create) >Dim enc As Encoding = Encoding.GetEncoding("utf-8") >Dim sw As New System.IO.StreamWriter(fs, enc) >serializer.Serialize(sw, sv) >sw.Close() >fs.Close()
私もShift-JISで書き込まれ、文字化けになったので、対処法を。(VS2012 for Desktop / .NET4.0 / Win8x64)
Dim serializer As New System.Xml.Serialization.XmlSerializer(GetType(SampleClass)) Dim fs As New System.IO.FileStream("aaa.txt", System.IO.FileMode.Create) Dim enc As Encoding = Encoding.GetEncoding("utf-8") Dim sw As New System.IO.StreamWriter(fs, enc) serializer.Serialize(sw, sv) sw.Close() fs.Close()
匿名 2024/03/21 (Thu) 11:09:52
よく見たら、publicが付いてなかった。ただ、それだけ...