使用此代码获取站点的rss.此代码适用于我的计算机和许多其他计算机.但在某些计算机(Windows XP或7)中,我收到此错误:MSXML未安装
我该如何解决这个问题?怎么了?
这是代码:
procedure My_Thread.Execute;
var
http : tidhttp;
strm : tmemorystream;
str,sTitle, sDec ,er : string;
StartItemNode : IXMLNode;
ANode : IXMLNode;
XMLDoc : IXMLDocument;
begin
http := tidhttp.Create();
strm := tmemorystream.Create;
try
http.Get('http://www.sample.com/rss.xml',strm); //Download the RSS file
SetString(str,PANSIChar(strm.Memory),strm.Size);
XMLDoc := LoadXMLData(str);
StartItemNode := XMLDoc.DocumentElement.ChildNodes.First.ChildNodes.FindNode('item');
ANode := StartItemNode;
i := 0;
repeat
inc(i);
sTitle := ANode.ChildNodes['title'].Text;
sDec := ANode.ChildNodes['description'].Text;
Synchronize(procedure begin //Synchronize? I'm using threads
case I of
1: begin
main_frm.edit1.text := sTitle; //main_frm is my form …Run Code Online (Sandbox Code Playgroud) 我在Delphi程序的线程内使用TIdHttp和TXMLDocument。现在我想知道: