1.API:http://zh.wikipedia.org/w/api.php

2.获取一个词条的内容:http://zh.wikipedia.org/w/api.php?action=parse&format=xml&page=keyWord

这个url获取的是一个XML,其中text节点包含的就是关键字对应页面的HTML。具体各个参数什么意思参考API说明。

3.查询 返回跟关键字匹配的若干词条的XML:http://zh.wikipedia.org/w/api.php?action=query&list=search&srwhat=text&format=xml&srsearch=keyword

4.HttpWebRequest获取Stream:

 

            HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(url);
            webRequest.UserAgent = "Mozilla/5.0";
            HttpWebResponse webResponse = (HttpWebResponse)webRequest.GetResponse();
            if (webResponse.StatusCode == HttpStatusCode.OK)
            {
                return webResponse.GetResponseStream();
            }

5.简繁体转换:

引用vb runtime 后

     private string StrConvent(string text, Microsoft.VisualBasic.VbStrConv type)
        {
            string str = Microsoft.VisualBasic.Strings.StrConv(text, type, 0);
            return str;

        } 

 

相关文章:

  • 2021-11-02
  • 2021-05-30
  • 2022-12-23
  • 2022-12-23
  • 2021-11-06
  • 2021-07-10
  • 2022-01-29
  • 2022-12-23
猜你喜欢
  • 2021-10-08
  • 2022-12-23
  • 2021-09-18
  • 2022-12-23
  • 2022-12-23
  • 2021-12-26
  • 2021-11-12
相关资源
相似解决方案