학교 출석부 만드는데 저장하고 로드하면 글짜가 깨져 버리니 알아 볼수있어야 뭐가 되든 할텐데
참고로 코드는
Public Class Form1
Dim Profile As Byte
Dim ofd As New OpenFileDialog
Private Sub PictureBox1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click
ofd.ShowDialog()
PictureBox1.Image = Image.FromFile(ofd.FileName)
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Timer1.Enabled = True
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Profile = NumericUpDown1.Value
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
My.Computer.FileSystem.WriteAllText("Profile\" & Profile & "-name.txt", Text1.Text, False)
My.Computer.FileSystem.WriteAllText("Profile\" & Profile & "-number.txt", Text2.Text, False)
My.Computer.FileSystem.WriteAllText("Profile\" & Profile & "-info.txt", TextBox1.Text, False)
My.Computer.FileSystem.WriteAllText("Profile\" & Profile & "-Date.txt", RichTextBox1.Text, False)
Try
IO.File.Copy(ofd.FileName, "Profile\" & Profile & "-image.jpg", False)
Catch ex As Exception
My.Computer.FileSystem.DeleteFile("Profile\" & Profile & "-image.jpg")
IO.File.Copy(ofd.FileName, "Profile\" & Profile & "-image.jpg", False)
End Try
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
PictureBox1.Image = Image.FromFile("Profile\" & Profile & "-image.jpg")
FileOpen(1, "Profile\" & Profile & "-name.txt", OpenMode.Input)
Text1.Text = LineInput(1)
FileClose()
FileOpen(1, "Profile\" & Profile & "-number.txt", OpenMode.Input)
Text2.Text = LineInput(1)
FileClose()
FileOpen(1, "Profile\" & Profile & "-info.txt", OpenMode.Input)
TextBox1.Text = LineInput(1)
FileClose()
FileOpen(1, "Profile\" & Profile & "-Date.txt", OpenMode.Input)
RichTextBox1.Text = LineInput(1)
FileClose()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
MessageBox.Show(Today)
End Sub
End Class
이렇고 만들어진 텍스트파일은 정상인데 로드하면 난리라서
utf-8이랑 cp949를 묶어서 검색하던지 vb.net 한글깨짐이라고 구글에 검색하던지
문제라면 영어로 하든 한글로 하든 뭐로 하든 다 깨짐