XML Reading with several data after “Name”

  Kiến thức lập trình

<Audio m_audio.bASIO=”false” m_audio.bEnable=”true” m_audio.nLevel=”100″ m_audio.nDevice=”-1″ m_audio.nChannels=”0″ m_audio.szDevice=”Default”/><Freq m_freq.n64RX=”2835000″ m_freq.n64TX=”10000000″ m_freq.n64RXOffset=”0″/><Mode m_mode.nMode=”0″/><Main m_main.nID=”0″ m_main.bTX=”false” m_main.bLock_0=”false”/><Filter m_filter.nLow=”100″ m_filter.nHigh=”2700″ m_filter.nTaps=”257″ m_filter.nWindowing=”3″/><AGC m_agc.nAGC=”1″ m_agc.levels_0.nDecay=”0″ m_agc.levels_0.nGain=”40″ m_agc.levels_0.nHang=”0″ m_agc.levels_0.nKnee=”0″ m_agc.levels_0.nSlope=”0″ m_agc.levels_1.nDecay=”250″ m_agc.levels_1.nGain=”0″ m_agc.levels_1.nHang=”100″ m_agc.levels_1.nKnee=”-130″ m_agc.levels_1.nSlope=”6″ m_agc.levels_2.nDecay=”500″ m_agc.levels_2.nGain=”0″ m_agc.levels_2.nHang=”250″ m_agc.levels_2.nKnee=”-130″ m_agc.levels_2.nSlope=”6″ m_agc.levels_3.nDecay=”1000″ m_agc.levels_3.nGain=”0″ m_agc.levels_3.nHang=”500″ m_agc.levels_3.nKnee=”-130″ m_agc.levels_3.nSlope=”6″/><CW m_cw.bEnable=”false” m_cw.nLevel=”48″/><NB m_nb.bEnable=”false” m_nb.nThreshold=”50″ m_nb.nWidth=”50″/><NR m_nr.bEnable=”false” m_nr.nMethod=”0″ m_nr.nLMSThreshold=”50″ m_nr.nRRNoise1=”5″ m_nr.nLMSWidth=”50″ m_nr.nLMSLevel=”10″ m_nr.nSpectralReduction_0=”3″ m_nr.nSpectralThreshold_0=”10″ m_nr.nSpectralRescale_0=”2″ m_nr.cleanup.nBins=”0″ m_nr.cleanup.nMultiply=”0″ m_nr.cleanup.nSquelch=”0″ m_nr.cleanup.nLevel=”0″ m_nr.cleanup.nWidth=”0″ m_nr.cleanup.bPCS=”0″ m_nr.cleanup.bSquelch=”0″/><Notch m_notch.bEnable=”false” m_notch.nLevel=”50″/><Squelch m_squelch.fm.hWnd=”69082″ m_squelch.fm.nMsg=”50078″ m_squelch.fm.bAuto=”false” m_squelch.fm.bCTCSS=”false” m_squelch.fm.bEnable=”false” m_squelch.fm.nCTCSSTone=”67000″ m_squelch.fm.nCTCSSLevel=”5″ m_squelch.fm.nLevel=”2″ m_squelch.vad.bEnable=”false” m_squelch.vad.nCache=”25″ m_squelch.vad.nLevel=”25″ m_squelch.vad.nHang=”250″/></CDSPDemodRX-v000>” />

I have a xml document with several data under the name “RX”.
So far i can only read the first name in “RX” that is “m_rx.nActive” which is value “0”.

I need to read 2 data:

  • Freq m_freq.n64RX=”2835000″ ‘i need the 2835000 value
  • Mode m_mode.nMode=”0″ ‘i need the “0” in “0&quot”

Can you help me please to resolve this problem ?

Many thanks
Raimund

Dim xmlToTxt As XmlReader = XmlReader.Create(filename)

    Do While xmlToTxt.Read()

        If xmlToTxt.NodeType = XmlNodeType.Element AndAlso xmlToTxt.Name = "RX" Then

            MsgBox(xmlToTxt.GetAttribute(0) & "   <>")  'm_rx.nActivate="0" i can read

        End If

    Loop

LEAVE A COMMENT