Step 1: First Virtualize a text file into an XML file, for example:
<? XML version = "1.0" encoding = "gb2312"?> <TXT> <br/> This is text content <br/> </TXT>
Step 2: upload to the Internet, for example, I am in: http://www.132435.com/down/test.txt
Step 3: Use the txmldocument control to read data. Only two rows are required. Code:
Unit unit1; interfaceuses windows, messages, sysutils, variants, classes, graphics, controls, forms, dialogs, xmldom, xmlintf, msxmldom, xmldoc, extctrls; Type tform1 = Class (tform) xmldocument1: txmldocument; Procedure formcreate (Sender: tobject); end; var form1: tform1; implementation {$ R *. DFM} procedure tform1.formcreate (Sender: tobject); begin xmldocument1.loadfromfile ('HTTP: // www.132435.com/down/test.txt'); showmessage (xmldocument1.documentelement. childnodes [0]. text); end.