Home > database > How to read through the Msxml in PB8 XML files on the WEB
How to read through the Msxml in PB8 XML files on the WEB
Time:10-01
And now have a project to the customer's mail system do interface Both sides to discuss sure to process the data by means of XML + HTTP communication 1. Each other on the web to send an XML file, tell me a email address 2. We read email address information in an XML file 3. We put this email address corresponding to the client code and customer name sent via the form of XML to the web
Now I found a piece of code on step 3, the HTML code is as follows, hope expert guidance, OLEObject dom, HTTP String Http_Name, result
Dom=CREATE OLEObject HTTP=CREATE OLEObject //messagebox debugging to see if success Messagebox (' HTTP 'HTTP. ConnectToNewObject (" Msxml2. XMLHTTP ")) Messagebox (' dom, dom. ConnectToNewObject (" Msxml2. DOMDocument "))
The dom. The Load (" D: \ test \ test XML ") HTTP. Open (" POST ", Http_Name, TRUE)//if TRUE here to switch to False, while part of the code can not HTTP. Send (dom) XML)//if found to have the code, please use HTTP. Send (dom) The do While HTTP. ReadyState & lt;> 4//query state, delay The yield () Loop
Result=HTTP. The responseText//this test! You don't write Messagebox (" result ", result)
Now about the step 1, I online, a program is as follows: //reads the XML file OleObject loo_dom, loo_node Int li_Result String as_xmlfile, as_value
Loo_dom=CREATE OleObject
Li_Result=loo_DOM. ConnectToNewObject (' Msxml2. DOMDocument ') IF li_Result & lt; 0 THEN MessageBox (' error: ', 'I'm sorry, but the DOM to create failure! ') RETURN END the IF
Loo_dom. Async=false
As_xmlfile='D: \ test \ down \ test XML' Loo_dom. Load (as_xmlfile)
If (loo_node. Length=0) THEN Messagebox (' error: ', "there is no data that you want!" ) Return The ELSE as_value=https://bbs.csdn.net/topics/loo_node.childNodes [1]. The text END the IF