jviana Posted May 17, 2012 at 10:54 AM Report #456353 Posted May 17, 2012 at 10:54 AM Boas, quero criar um .txt com um encoding específico: Unicode. O meu código: Sub pastains() System.IO.Directory.CreateDirectory(pasta) Using insnew As New StreamWriter(insPath, System.Text.Encoding.UTF32) End Using End Sub No insnew, dá este erro: [/i] [i]Error 1 Overload resolution failed because no accessible 'New' can be called with these arguments: 'Public Sub New(path As String, append As Boolean)': Value of type 'System.Text.Encoding' cannot be converted to 'Boolean'. 'Public Sub New(stream As System.IO.Stream, encoding As System.Text.Encoding)': Value of type 'String' cannot be converted to 'System.IO.Stream'. C:\Programas Feitos Por Mim\VB.Net\STF - Partituras\S.F.T. - Organizador de Partituras de Maestro\Form1.vb 65 15 S.F.T. - Organizador de Partituras de Maestro[/i] [i] O que é que eu faço? Cumps. J.Viana Learning VB.Net HTML C/C++
Caça Posted May 17, 2012 at 11:02 AM Report #456355 Posted May 17, 2012 at 11:02 AM (edited) Não estás a obedecer a todos os parâmetros nesse overload, tenta com Using insnew As New StreamWriter(insPath, False, System.Text.Encoding.UTF32) Edited May 17, 2012 at 11:02 AM by Caça Pedro Martins Não respondo a duvidas por PM
jviana Posted May 17, 2012 at 05:47 PM Author Report #456480 Posted May 17, 2012 at 05:47 PM Neste momento não posso tentar, mas para que serve o False? Learning VB.Net HTML C/C++
anolsi Posted May 17, 2012 at 05:57 PM Report #456483 Posted May 17, 2012 at 05:57 PM Neste momento não posso tentar, mas para que serve o False? É o append. Pode ser para pegar no ficheiro casa exista e continuar a escrever do fim (no caso de true), ou para apagar o que lá estava e começar o ficheiro do 0 (no caso do false) "Nós somos o que fazemos repetidamente, a excelência não é um feito, e sim, um hábito."Não respondo a questões por PM que possam ser colocadas no fórum!
jviana Posted May 17, 2012 at 07:21 PM Author Report #456518 Posted May 17, 2012 at 07:21 PM Funcionou Obrigado Cumps. J.Viana Learning VB.Net HTML C/C++
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now