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_licensing_response><status>ERROR_MAXCOUN T</status><days_since_last_assigned>1</days_since_last_assigned><days_till_expiration>358 </days_till_expiration><use_count>1</use_count></plimus_licensing_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_CODE</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.Focus()
Else
Dim request As Net.HttpWebRequest
Dim response As Net.HttpWebResponse
Dim url As String =
"https://www.plimus.com/jsp/validateKey.jsp?action=REGISTER&productId=#####&ke y="
& tbxLicense.Text & "&action=REGISTER &uniqueMachineId&=" & GetOSProductKey()
& eMail.Text & Username.Text
request = Net.WebRequest.Create(url)
request.Method = "Get"
response = request.GetResponse()
Dim sr As IO.StreamReader = New
IO.StreamReader(response.GetResponseStream())
Dim responseContent As String = sr.ReadToEnd()
sr.Close()
response.Close()
Dim reader As Xml.XmlTextReader = Nothing
tbxResponseContent.Text = responseContent
I've looked at code samples and have started with the Dim reader as
Xml.XmlTextReader = Nothing
The XML response is currently returned to a textbox called
tbxResponseContent.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?ZVNvbFRlYywgSW5jLiA1MDEoYykoMyk=?= <es*****@noemail.nospam>
wrote in news:B5**********************************@microsof t.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.