VB.NET 中OpenFileDialog控件打开的TXT文件里面有乱码
VB.NETCODE:PrivateSubButton2_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArg...
VB.NET CODE: Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
OpenFileDialog1.ShowDialog()
End Sub Private Sub OpenFileDialog1_FileOk(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles OpenFileDialog1.FileOk
Dim filepath As String = OpenFileDialog1.FileName
Dim stremreaderregex As StreamReader = File.OpenText(filepath)
Me.TextBox1.Text = stremreaderregex.ReadToEnd()
stremreaderregex.Close()
End Sub 展开
OpenFileDialog1.ShowDialog()
End Sub Private Sub OpenFileDialog1_FileOk(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles OpenFileDialog1.FileOk
Dim filepath As String = OpenFileDialog1.FileName
Dim stremreaderregex As StreamReader = File.OpenText(filepath)
Me.TextBox1.Text = stremreaderregex.ReadToEnd()
stremreaderregex.Close()
End Sub 展开
1个回答
2013-07-26
展开全部
Dim stremreaderregex As StreamReader = File.OpenText(filepath)
这纯棚敬陵句改为做稿则:Dim stremreaderregex As StreamReader = New StreamReader(filepath, Encoding.Default)
这纯棚敬陵句改为做稿则:Dim stremreaderregex As StreamReader = New StreamReader(filepath, Encoding.Default)
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询