本文整理汇总了C#中Author.setresArea方法的典型用法代码示例。如果您正苦于以下问题:C# Author.setresArea方法的具体用法?C# Author.setresArea怎么用?C# Author.setresArea使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Author
的用法示例。
在下文中一共展示了Author.setresArea方法的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
{
//.........这里部分代码省略.........