vb.net 用savefiledialog保存的文件是乱码
PrivateSubButton2_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesBu...
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim tt As String
SaveFileDialog1.Filter = "text文件|*.txt|rtf文件|*.rtf"
SaveFileDialog1.FilterIndex = 1
SaveFileDialog1.ShowDialog()
tt = SaveFileDialog1.FileName
RichTextBox1.SaveFile(tt)
End Sub
代码如上,如:新年快乐会变成 {\rtf1\ansi\ansicpg936\deff0\deflang1033\deflangfe2052{\fonttbl{\f0\fnil\fcharset134 \'cb\'ce\'cc\'e5;}}
\viewkind4\uc1\pard\lang2052\f0\fs18\'d0\'c2\'c4\'ea\'bf\'ec\'c0\'d6\par
} 展开
Dim tt As String
SaveFileDialog1.Filter = "text文件|*.txt|rtf文件|*.rtf"
SaveFileDialog1.FilterIndex = 1
SaveFileDialog1.ShowDialog()
tt = SaveFileDialog1.FileName
RichTextBox1.SaveFile(tt)
End Sub
代码如上,如:新年快乐会变成 {\rtf1\ansi\ansicpg936\deff0\deflang1033\deflangfe2052{\fonttbl{\f0\fnil\fcharset134 \'cb\'ce\'cc\'e5;}}
\viewkind4\uc1\pard\lang2052\f0\fs18\'d0\'c2\'c4\'ea\'bf\'ec\'c0\'d6\par
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询