当前位置: 首页>>代码示例>>C#>>正文


C# Author.setstatsGraphUrl方法代码示例

本文整理汇总了C#中Author.setstatsGraphUrl方法的典型用法代码示例。如果您正苦于以下问题:C# Author.setstatsGraphUrl方法的具体用法?C# Author.setstatsGraphUrl怎么用?C# Author.setstatsGraphUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Author的用法示例。


在下文中一共展示了Author.setstatsGraphUrl方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GSParseProfile

        public void GSParseProfile(Uri URL)
        {

            String strResponse = this.GSTryConnect(URL);

            HtmlDocument document = new HtmlDocument();
            document.Load(new StringReader(strResponse));

            String authorName = "";
            String residence = "";
            String interest = "";
            String hindex = "";
            String iindex = "";
            String totalcitations = "";

            this.resultList.resultType = this.query.resultType;
            this.resultList.loadType();

            SearchType type;


            Author author = new Author();
            author.setresArea("");
            author.setstatsGraphUrl(new Uri("http://google.com"));
            author.setinstitute("");





            HtmlNode profileNode = document.DocumentNode.SelectSingleNode("//div[@class='g-section g-tpl-250-alt']//div[@class='g-unit']");
            if (profileNode != null)
            {
                //Console.WriteLine("hey");
                // Console.WriteLine(profileNode.InnerText);
                //   Author author = new Author();
                HtmlNode userInfoNode = profileNode.SelectSingleNode("//div[@class='cit-user-info']//div[@class='g-unit']");

                HtmlNode userNameNode = userInfoNode.SelectSingleNode("//span[@id='cit-name-read']");

                authorName = userNameNode.InnerText;
                author.setname(authorName);

                HtmlNode userResidenceNode = userInfoNode.SelectSingleNode("//span[@id='cit-affiliation-read']");

                residence = userResidenceNode.InnerText;
                author.setinstitute(residence);

                HtmlNode userInterestNode = userInfoNode.SelectSingleNode("//span[@id='cit-int-read']");

                interest = userInterestNode.InnerText;
                author.setresArea(interest);

                Console.WriteLine("Author " + authorName + residence + interest);

                HtmlNode dataNode = profileNode.SelectSingleNode("div[@class='cit-lbb']//table//tr//table[@id='stats']");

                if (dataNode != null)
                {
                    int i = 0;
                    foreach (HtmlNode hindexNode in dataNode.SelectNodes("tr//td[@class='cit-borderleft cit-data']"))
                    {
                        if (i == 0)
                        {
                            totalcitations = hindexNode.InnerText;
                            author.setnumPapers(Convert.ToInt32(totalcitations));
                        }

                        else if (i == 2)
                        {
                            hindex = hindexNode.InnerText;
                            author.sethIndex(Convert.ToInt32(hindex));
                        }

                        else if (i == 4)
                        {
                            iindex = hindexNode.InnerText;
                            author.setiIndex(Convert.ToInt32(iindex));
                        }

                        i++;
                    }

                    HtmlNode imageNode = profileNode.SelectSingleNode("div[@class='cit-lbb']//table//td[@valign='top']//img[@src]");

                    String url = imageNode.Attributes["src"].Value;
                    Console.WriteLine(hindex + "hey " + iindex + "hi" + totalcitations + " " + url);
                    url = System.Net.WebUtility.HtmlDecode(url);
                    var strUrl = new Uri(url);
                    author.setstatsGraphUrl(strUrl);
                    type = author;
                    this.resultList.type = type;



                }

            }
            else
            {
//.........这里部分代码省略.........
开发者ID:srinivasans,项目名称:OpenSoft2013,代码行数:101,代码来源:Parser.cs


注:本文中的Author.setstatsGraphUrl方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。