Ciao a tutti,
sto creando un programma in cui mi serve aprire i file con codifica in italiano. La routine è questa:
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim args = Environment.GetCommandLineArgs()
'The first commandline argument is the path of the EXE.
'If there is just one more argument and it's a file, read it as text and display it.
'The first commandline argument is the path of the EXE.
'If there is just one more argument and it's a file, read it as text and display it.
If args.Length = 2 AndAlso File.Exists(args(1)) Then
Using reader As StreamReader = New StreamReader(args(1), System.Text.Encoding.GetEncoding("Latin1"))
Dim tit As String = openFileDialog.Title
TextBox1.Text = reader.ReadToEnd()
Me.Text = args(1)
End Using
End If
TextBox1.SelectionStart = 0
End Sub
Ho provato tutte le codifiche. La migliore è Latin1, ma mi elimina tutti gli apostrofi.
Chi mi aiuta a risolvere il problema?
Grazie in anticipo