Thank you for your response. The XML is streamed into a string I believe and
I can give you all the code that's used and that is being returned.
<plimus_licensi ng_response><st atus>ERROR_MAXC OUNT</status><days_si nce_last_assign ed>1</days_since_last _assigned><days _till_expiratio n>358</days_till_expir ation><use_coun t>1</use_count></plimus_licensin g_response>
This is the string information that is returned from the license company.
The part that I need to parse and run logic on is the
<status>ERROR_C ODE</status>
Based on the error_code, I need to build the IF Then Else statement to make
the code either open the program, return a message to the user, close the
program and refer the user to the support website.
Here is the code I'm using to return the values.
If Username.Text = "" And eMail.Text = "" And tbxLicense.Text = "" Then
MessageBox.Show ("Please enter your registered name.")
Username.Focus( )
ElseIf Username.Text <"" And eMail.Text = "" And tbxLicense.Text =
"" Then
MessageBox.Show ("Please enter the person's email for this
computer")
eMail.Focus()
ElseIf Username.Text <"" And eMail.Text <"" And tbxLicense.Text
= "" Then
MessageBox.Show ("Please enter the license number:
###-####-####-####")
tbxLicense.Focu s()
Else
Dim request As Net.HttpWebRequ est
Dim response As Net.HttpWebResp onse
Dim url As String =
"https://www.plimus.com/jsp/validateKey.jsp ?action=REGISTE R&productId=### ##&key="
& tbxLicense.Text & "&action=REGIST ER &uniqueMachineI d&=" & GetOSProductKey ()
& eMail.Text & Username.Text
request = Net.WebRequest. Create(url)
request.Method = "Get"
response = request.GetResp onse()
Dim sr As IO.StreamReader = New
IO.StreamReader (response.GetRe sponseStream())
Dim responseContent As String = sr.ReadToEnd()
sr.Close()
response.Close( )
Dim reader As Xml.XmlTextRead er = Nothing
tbxResponseCont ent.Text = responseContent
I've looked at code samples and have started with the Dim reader as
Xml.XmlTextRead er = Nothing
The XML response is currently returned to a textbox called
tbxResponseCont ent.Text. The XML stream is the responseContent .
--
Michael Bragg, President
eSolTec, Inc.
a 501(C)(3) organization
MS Authorized MAR
looking for used laptops for developmentally disabled.
"Spam Catcher" wrote:
=?Utf-8?B?ZVNvbFRlYyw gSW5jLiA1MDEoYy koMyk=?= <es*****@noemai l.nospam>
wrote in news:B5******** *************** ***********@mic rosoft.com:
I tried:
'If responseContent = "<status>STATUS _CODE</status>" Then
Perhaps more data than that is coming back.
but the code doesn't capture the XML stream. What do I need please?
Take a look at the System.Text.XML classes - you should load the entire doc
into one of the XML class structures (XML Doc, XML reader, etc) and use
those classes to parse the response. You'll get a more accurate result than
merely text parsing.