Public Function nodo(ByVal archivo As String, ByVal tag As String, ByVal deep As Integer) As String Dim sr As New StreamReader(Directory.GetCurrentDirectory & "\" & Form1.sdp & archivo, Encoding.UTF8) Dim i As Integer = 0 Dim dato As String = "" Dim linea As String = sr.ReadLine() While linea IsNot Nothing If linea.Contains(tag) Then i += 1 End If If i = deep Then dato = linea.Substring(tag.Length, linea.Length - 2 * tag.Length - 1) Exit While End If linea = sr.ReadLine().Trim End While sr.Close() sr.Dispose() Return dato End Function
viernes, 28 de abril de 2017
Obtener dato de un nodo xml
Etiquetas:
Contains,
Encoding,
GetCurrentDirectory,
ReadLine,
StreamReader,
xml
Suscribirse a:
Comentarios de la entrada (Atom)
No hay comentarios.:
Publicar un comentario