A core feature of Visual Studio that allows developers to inspect, analyze, and troubleshoot code during execution.
Thank you for all people,
i solve the problem
it is easy
i convent the variable restultado to Lowercase. it work now.
Thank you
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello People, Good Night,
The code above generate the Exception System.ArgumentException: 'Escape sequence not recognized. (48):
Dim resposta As String ="{"SUCCESS":0,"IDERRO":1,"ERRO":"O CAMPO NOME \U00E9 OBRIGAT\U00F3RIO"}"
Dim obj As Object = New JavaScriptSerializer().Deserialize(Of Object)(resposta.ToString())
How i solve the problem ?
Thank you
César Oliveira
A core feature of Visual Studio that allows developers to inspect, analyze, and troubleshoot code during execution.
Thank you for all people,
i solve the problem
it is easy
i convent the variable restultado to Lowercase. it work now.
Thank you
No, i cant change the code json.
it is necessary manipulate the variable resposta to acept the Escape sequence not recognized
I tried other code but not work, it generate another exception. The code is:
Dim resposta As String ="{"SUCCESS":0,"IDERRO":1,"ERRO":"O CAMPO NOME \U00E9 OBRIGAT\U00F3RIO"}"
Dim stream = New MemoryStream(Encoding.UTF8.GetBytes(resposta.ToString()))
Dim obj As Object = New JavaScriptSerializer().Deserialize(Of MensagemErro)(stream.toString())
The exeption is System.ArgumentException: 'Invalid JSON primitive: System.IO.MemoryStream.'
Thank you
Hi @César Oliveira ,
You could use Chrw() function to recognize escape sequence in visual basic, which is like:
"O CAMPO NOME \U00E9 OBRIGAT\U00F3RIO" -> "O CAMPO NOME" + ChrW(&HE9) + " OBRIGAT" + ChrW(&HF3) + "RIO"
Best Regards,
Dylan
Not is possíble.
This json came of WebService
I can't change the json
How i solve the problema in vb.net ?
Thank you
@César Oliveira - your JSON string, resposta has an escape sequence that VS does not recognize. The "\U" within the JSON string is not supported. You should change the \U to \U.