Quantcast
Channel: Tópicos
Viewing all articles
Browse latest Browse all 11336

Substituir valor de uma linha

$
0
0
Os values nessas 3 linhas são sempre iguais? Podes fazer uma função deste tipo para achares o valor do value: Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim valorDoValue As String = GetValueOfValue("<setting name=""authorization_username"" value=""789""/> ") MessageBox.Show(valorDoValue) End Sub Private Function GetValueOfValue(ByVal str As String) As String Dim startAt As Integer = str.IndexOf("value=") + "value=".Length + 1 Dim finishAt As Integer = str.IndexOf("/>", startAt) - 1 Return str.Substring(startAt, finishAt - startAt) End Function End Class Depois fazes o replace

Viewing all articles
Browse latest Browse all 11336

Latest Images

Trending Articles



Latest Images