Skip to content

Commit

Permalink
选择包含作者的话
Browse files Browse the repository at this point in the history
  • Loading branch information
fffonion committed Jun 1, 2022
1 parent 9c2656e commit d4259ba
Show file tree
Hide file tree
Showing 4 changed files with 107 additions and 62 deletions.
18 changes: 16 additions & 2 deletions Novel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class Novel
private string savePath;
public bool isFinnished;
private bool useMobileEdition = true;
private bool includeAuthorsWords = true;
private HttpUtil _savedHttpUtil = null;
private string cookiestr;
public string userDetail;
Expand Down Expand Up @@ -56,6 +57,11 @@ public void setUseMobile(bool use)
this.useMobileEdition = use;
}

public void setIncludeAuthorsWords(bool inc)
{
this.includeAuthorsWords = inc;
}

public void registerSetProgressDelegate(Action<String, Color> d)
{
this.setProgressDelegate = d;
Expand Down Expand Up @@ -413,9 +419,17 @@ public Chapter getSingleChapter(int chapter)
}
}
chpt.title = novelnode.SelectSingleNode("./div/h2").InnerText;

//作者的话
HtmlNode hn2 = root.SelectSingleNode("//div[@class='readsmall']");
chpt.content = parseText_Img_Link(hn2);
if (this.includeAuthorsWords)
{
HtmlNode hn2 = root.SelectSingleNode("//div[@class='readsmall']");
chpt.content = parseText_Img_Link(hn2);
} else
{
chpt.content = "";
}

//内容
List<HtmlNode> hnl = novelnode.SelectNodes("./div|./font|./hr|./img|./script").ToList();
foreach(HtmlNode hn in hnl){
Expand Down
4 changes: 2 additions & 2 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
// 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.3.1")]
[assembly: AssemblyFileVersion("1.3.1")]
[assembly: AssemblyVersion("1.3.2")]
[assembly: AssemblyFileVersion("1.3.2")]
Loading

0 comments on commit d4259ba

Please sign in to comment.