AriOps Posted July 17, 2006 at 04:33 PM Report #38671 Posted July 17, 2006 at 04:33 PM Boas, Estou a criar uma aplicação em vb.net 2005 e surgiu a necessidade de desenvolver um sistema de profiles. Pensei logo em usar XML por pensar ser a mais funcional e também porque gostava de aprender a trabalhar com estes ficheiros. Já criei um ficheiro XML, agora o que eu não sei é: - Como aceder - Como manipular Se alguém pudesse ajudar agradecia, também já vi o Nazgulled a falar sobre isto algures 🙂 Cumps Daniel Correia
Guest id194 Posted July 18, 2006 at 12:16 AM Report #38777 Posted July 18, 2006 at 12:16 AM eu uso uma classe que saquei da net ha uns tempos: http://www.fawcette.com/vsm/2002_10/magazine/columns/gettingstarted/
Tiago Salgado Posted July 18, 2006 at 08:39 AM Report #38791 Posted July 18, 2006 at 08:39 AM Eu uso o System.Xml ( XmlWriter, XmlReader, etc etc) ... explora tambem o XPath...
Delta Posted July 21, 2006 at 09:24 AM Report #39328 Posted July 21, 2006 at 09:24 AM alguns exemplos usando o SYSTEM.XML system.xml 'Reading xml Private Sub Read_XML() Dim XMLReader As Xml.XmlReader XMLReader = New Xml.XmlTextReader("List.xml") While XMLReader.Read Select Case XMLReader.NodeType Case Xml.XmlNodeType.Element If XMLReader.AttributeCount > 0 Then While XMLReader.MoveToNextAttribute If XMLReader.Name = "File" Then ListBox1.Items.Add(XMLReader.Value) ElseIf XMLReader.Name = "Title" Then ListBox2.Items.Add(XMLReader.Value) Else ' Do Nothing End If End While End If End Select End While XMLReader.Close() End Sub 'Writing xml Private Sub Write_XML() Dim XMLobj As Xml.XmlTextWriter Dim ue As New System.[Text].UnicodeEncoding() XMLobj = New Xml.XmlTextWriter("List.xml", ue) XMLobj.Formatting = Xml.Formatting.Indented XMLobj.Indentation = 3 XMLobj.WriteStartDocument() XMLobj.WriteStartElement("List") Dim i As Integer For i = 0 To ListBox1.Items.Count - 1 XMLobj.WriteStartElement("MP3_File") Dim temp As String = "" Dim temp1 As String = "" ListBox1.SetSelected(i, True) ListBox2.SetSelected(i, True) temp = ListBox1.SelectedItem temp1 = ListBox2.SelectedItem XMLobj.WriteAttributeString("File", temp) XMLobj.WriteAttributeString("Title", temp1) XMLobj.WriteEndElement() Next XMLobj.WriteEndElement() XMLobj.Close() End Sub
vbmaster Posted July 21, 2006 at 10:56 AM Report #39356 Posted July 21, 2006 at 10:56 AM Usa o Geshi delta.
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