您的位置:程序门 -> web 开发 -> asp



求xmlhttp在vc里应用的完整例子一个,谢谢!


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


求xmlhttp在vc里应用的完整例子一个,谢谢![已结贴,结贴人:claider]
发表于:2007-04-28 09:39:17 楼主
或者求抓取并提取网页内容的源代码,vc下的。谢谢!
发表于:2007-04-28 10:15:461楼 得分:0
读取网页内容
http://community.csdn.net/expert/topic/5100/5100666.xml?temp=.4011652
发表于:2007-04-28 11:28:002楼 得分:100
msdn有完整例子
ms-help://ms.msdnqtr.v80.chs/ms.msdn.v80/ms.win32com.v10.en/xmlsdk/html/63409298-0516-437d-b5af-68368157eae3.htm

#import   "msxml3.dll "
using   namespace   msxml2;

void   xmlhttprequestsample()
{
      ixmlhttprequestptr   pixmlhttprequest   =   null;
      bstr   bstrstring   =   null;
      hresult   hr;

      try   {
            hr=pixmlhttprequest.createinstance( "msxml2.xmlhttp.3.0 ");
            succeeded(hr)   ?   0   :   throw   hr;

            hr=pixmlhttprequest-> open( "get ",   "http://localhost/books.xml   ",   false);
            succeeded(hr)   ?   0   :   throw   hr;

            hr=pixmlhttprequest-> send();
            succeeded(hr)   ?   0   :   throw   hr;

            bstrstring=pixmlhttprequest-> responsetext;

            messagebox(null,   _bstr_t(bstrstring),   _t( "results "),   mb_ok);

            if(bstrstring)
            {
                  ::sysfreestring(bstrstring);
                  bstrstring   =   null;
            }

      }   catch   (...)   {
            messagebox(null,   _t( "exception   occurred "),   _t( "error "),   mb_ok);
            if(bstrstring)
                  ::sysfreestring(bstrstring);
      }

}
发表于:2007-04-28 13:07:543楼 得分:0
回复人:cathysun118(斯年)   (   五级(中级))   信誉:100   2007-04-28   10:15:46   得分:0
?  
读取网页内容
http://community.csdn.net/expert/topic/5100/5100666.xml?temp=.4011652
--------------
error   loading   stylesheet:   parsing   an   xslt   stylesheet   failed.

发表于:2007-04-28 15:23:194楼 得分:0
我需要实现如下功能,问问诸位有没有好的建议:
1、向某个网站法请求,搜索某些条件组合的得到的数据,比如在www.pconline.com.cn上搜索诺基亚牌2007年上市的5000块以内的直板手机
2、分析收到的网页,提取数据,插到自己的数据库中

这个大概怎么玩?


快速检索

最新资讯
热门点击