• R/O
  • SSH
  • HTTPS

autocodeforsql: Commit


Commit MetaInfo

Revisão382 (tree)
Hora2020-09-14 17:58:03
Autorhilinwei

Mensagem de Log

Mudança Sumário

Diff

--- AutoEpub3/AutoEpub7.vb (revision 381)
+++ AutoEpub3/AutoEpub7.vb (revision 382)
@@ -836,6 +836,17 @@
836836
837837 Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
838838
839+
840+ Dim sText As String = "ABCDE"
841+ Dim listCHK As List(Of String) = {"A", "B", "K"}.ToList
842+
843+
844+ Dim kke As Boolean = listCHK.Any(Function(x) sText.Contains(x))
845+
846+
847+
848+
849+
839850 Dim listMobiRight As List(Of String) = {"bodytext-right"}.ToList()
840851
841852 Dim listError As New List(Of String)
--- AutoEpub3/AutoEpub8.Designer.vb (revision 381)
+++ AutoEpub3/AutoEpub8.Designer.vb (revision 382)
@@ -25,6 +25,7 @@
2525 Me.Button5 = New System.Windows.Forms.Button()
2626 Me.Button1 = New System.Windows.Forms.Button()
2727 Me.Button2 = New System.Windows.Forms.Button()
28+ Me.Button3 = New System.Windows.Forms.Button()
2829 Me.SuspendLayout()
2930 '
3031 'Button5
@@ -54,11 +55,21 @@
5455 Me.Button2.Text = "NCX Dep 2"
5556 Me.Button2.UseVisualStyleBackColor = True
5657 '
58+ 'Button3
59+ '
60+ Me.Button3.Location = New System.Drawing.Point(594, 223)
61+ Me.Button3.Name = "Button3"
62+ Me.Button3.Size = New System.Drawing.Size(173, 69)
63+ Me.Button3.TabIndex = 19
64+ Me.Button3.Text = "NCX Dep 2"
65+ Me.Button3.UseVisualStyleBackColor = True
66+ '
5767 'AutoEpub8
5868 '
5969 Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 12.0!)
6070 Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
6171 Me.ClientSize = New System.Drawing.Size(800, 450)
72+ Me.Controls.Add(Me.Button3)
6273 Me.Controls.Add(Me.Button2)
6374 Me.Controls.Add(Me.Button1)
6475 Me.Controls.Add(Me.Button5)
@@ -71,4 +82,5 @@
7182 Friend WithEvents Button5 As Button
7283 Friend WithEvents Button1 As Button
7384 Friend WithEvents Button2 As Button
85+ Friend WithEvents Button3 As Button
7486 End Class
--- AutoEpub3/AutoEpub8.vb (revision 381)
+++ AutoEpub3/AutoEpub8.vb (revision 382)
@@ -120,5 +120,21 @@
120120
121121 Console.WriteLine(KKE)
122122 End Sub
123+
124+ Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
125+
126+ Dim cAutoEpub As New cDep2_003("C:\Users\DTC_PC07\Downloads\dygw\OEBPS\")
127+ cAutoEpub.CreadEpub()
128+
129+ Dim cEpub As New cEpub6(emEpub6.emEncCode.GB2321, emEpub6.emLan.ZH, "A1", "天下刀宗", "雨楼清歌", "TXDZ_202009")
130+ cEpub.bConvertToMobi = True
131+ cEpub.CreateEpub(cAutoEpub.mEpub)
132+ MessageBox.Show("Finished")
133+ System.Diagnostics.Process.Start(cEpub.sOutPutPathFolder)
134+
135+
136+ End Sub
137+
138+
123139 End Class
124140
--- AutoEpub3/Logic/DEP2/cDep2_003.vb (nonexistent)
+++ AutoEpub3/Logic/DEP2/cDep2_003.vb (revision 382)
@@ -0,0 +1,101 @@
1+Imports System.IO
2+
3+Public Class cDep2_003
4+
5+ Dim bookPath As String
6+
7+ Public mEpub As New List(Of modelVolume)
8+
9+ Dim listSkip As List(Of String) = {"版权", "目录", "书名页", "版权页", "作家榜经典文库", "勇者物语"}.ToList
10+ Dim listMobiRight As List(Of String) = {"signature"}.ToList()
11+
12+
13+
14+ Sub New(_bookPath As String)
15+ bookPath = _bookPath
16+ End Sub
17+
18+
19+ Public Sub CreadEpub()
20+
21+
22+ Dim listTTT As New List(Of modelChapter)
23+
24+ For iCtr As Integer = 0 To 4
25+
26+ Dim sPath As String = "C:\Users\DataTrade\Downloads\K1\OEBPS\Text\part0002_split_00" & iCtr & ".xhtml"
27+ Dim sHtml As String = cTools.sFileReader(sPath, cEpub6.encUTF8)
28+
29+ Dim hapHtml As HtmlAgilityPack.HtmlDocument = New HtmlAgilityPack.HtmlDocument()
30+ hapHtml.LoadHtml(sHtml)
31+ Dim listDel1 As List(Of HtmlAgilityPack.HtmlNode) = hapHtml.DocumentNode.SelectNodes(("//h2[contains(@class, 'kindle-cn-heading1')]")).ToList()
32+
33+ If listDel1 IsNot Nothing Then
34+
35+ For iCtrSub As Integer = 0 To listDel1.Count - 1
36+
37+ Dim sTemp As String = ""
38+ If iCtrSub < listDel1.Count - 1 Then
39+ sTemp = cTools.listNav_SE(sHtml, listDel1(iCtrSub).OuterHtml, listDel1(iCtrSub + 1).OuterHtml, True)(0)
40+ Else
41+ sTemp = cTools.listNav_SE(sHtml, listDel1(iCtrSub).OuterHtml, True)(0)
42+ End If
43+
44+
45+ Dim hapHtmlSub As HtmlAgilityPack.HtmlDocument = New HtmlAgilityPack.HtmlDocument()
46+ hapHtmlSub.LoadHtml(sTemp)
47+
48+ Dim listHdr As List(Of HtmlAgilityPack.HtmlNode) = hapHtmlSub.DocumentNode.SelectNodes(("//h2[contains(@class, 'kindle-cn-heading1')]")).ToList()
49+
50+ Dim listDtl As List(Of HtmlAgilityPack.HtmlNode) = hapHtmlSub.DocumentNode.SelectNodes(("//p")).ToList()
51+
52+
53+ Dim addChapter As New modelChapter
54+
55+
56+ addChapter.Title = listHdr(0).InnerText
57+
58+ For Each uAdd As HtmlAgilityPack.HtmlNode In listDtl
59+
60+ addChapter.listText.Add(uAdd.InnerText)
61+
62+ Next
63+
64+
65+ listTTT.Add(addChapter)
66+ Next
67+
68+ End If
69+
70+ Next
71+
72+
73+
74+ Dim listVolueTitle As List(Of String) = {"第一章 秋水刻剑", "第二章 夜雨青锋", "第三章 春草惊弦", "第四章 竹声新月", "第五章 昆山雪刃"}.ToList
75+
76+
77+ For Each uVTitle As String In listVolueTitle
78+
79+ Dim addVolume As New modelVolume
80+
81+ addVolume.Title = uVTitle
82+
83+
84+
85+ Dim linqChpat = From dtSeq In listTTT Where dtSeq.Title.IndexOf(uVTitle) > -1
86+
87+ For Each addChapt As modelChapter In linqChpat
88+ addVolume.listChapter.Add(addChapt)
89+ Next
90+
91+
92+ mEpub.Add(addVolume)
93+
94+ Next
95+
96+
97+
98+ End Sub
99+
100+
101+End Class
Show on old repository browser