PintoAfonso Posted October 14, 2007 at 09:07 AM Report Share #139910 Posted October 14, 2007 at 09:07 AM Eu estou a fazer como se segue, mas não funciona, pretendia criar um ficheiro e gravar um pathDesenho.pathData, mas dis que este ficheiro é de texto e pathDesenho.pathData não pode ser convertido em texto, agradecia uma pequena ajuda que para mim seria uma grande ajuda. Tentei para gravar dados = pathDesenho.PathData SaveEstrutura.FileName = "ActualFicheiro" With SaveEstrutura .Title = "Escreva o nome do ficheiro " .DefaultExt = "inp" .Filter = "Guardar os dados (*.inp)|*.inp" .ShowDialog() End With Dim ficheiro As String = SaveEstrutura.FileName Dim ficheiroStream As New FileStream(ficheiro, FileMode.Create, FileAccess.Write, FileShare.ReadWrite) Dim escrever As New StreamWriter(ficheiroStream) escrever.WriteLine(dados) escrever.Close() ficheiroStream.Close() tentei para abrir With OpenFileDialog1 .FileName = "" .Title = "Selecionar ficheiro :" '.Filter = "Entrada de dados (*.inp)|*.inp|Todos (*.*)|*.*" .Filter = "Entrada de dados (*.inp)|*.inp" .ShowDialog() End With Dim ficheiro As String = OpenFileDialog1.FileName ActualFicheiro = OpenFileDialog1.FileName Dim ficheiroStream As New FileStream(ficheiro, FileMode.Open, FileAccess.Read) Dim leitura As New StreamReader(ficheiroStream) ActualFicheiro = leitura.ReadLine dados = leitura.ReadLine 'pathDesenho.PathData = dados leitura.Close() ficheiroStream.Close() End Sub Link to comment Share on other sites More sharing options...
NuGuN Posted October 14, 2007 at 03:59 PM Report Share #140014 Posted October 14, 2007 at 03:59 PM Qual é a linguagem que estas a utilizar? vb.net? Cumps Link to comment Share on other sites More sharing options...
Tiago Salgado Posted October 14, 2007 at 04:04 PM Report Share #140015 Posted October 14, 2007 at 04:04 PM Convem mostrares que informação é gravada no tal pathDesenho.PathData Link to comment Share on other sites More sharing options...
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