• R/O
  • SSH
  • HTTPS

autocodeforsql: Commit


Commit MetaInfo

Revisão357 (tree)
Hora2020-03-27 16:51:09
Autorhilinwei

Mensagem de Log

Mudança Sumário

Diff

--- AutoEpub3/AutoEpub7.vb (revision 356)
+++ AutoEpub3/AutoEpub7.vb (revision 357)
@@ -248,7 +248,7 @@
248248
249249 Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
250250
251- Dim dEpubPath As String = "C:\Users\DataTrade\Downloads\GZ\"
251+ Dim dEpubPath As String = "C:\Users\DataTrade\Downloads\SB\"
252252 Dim mEpub As New List(Of modelChapter)
253253 Dim mChapter As New modelChapter
254254 Dim sChapter As String = String.Empty
@@ -258,7 +258,7 @@
258258
259259 Dim listMobiRight As List(Of String) = {"kindle-cn-signature"}.ToList()
260260 Dim listRep As New List(Of cValues)
261- listRep.Add(New cValues("<br class=""calibre7""/>", "</p><p class=""kindle-cn-poem-left"">"))
261+ listRep.Add(New cValues("<br class=""calibre10""/>", "</p><p class=""kindle-cn-signature"">"))
262262
263263
264264 Try
@@ -707,9 +707,14 @@
707707
708708 Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
709709
710+ Dim listMobiRight As List(Of String) = {"kindle-cn-signature"}.ToList()
711+ Dim listRep As New List(Of cValues)
712+ listRep.Add(New cValues("<br class=""calibre10""/>", "</p><p class=""kindle-cn-signature"">"))
713+
714+
710715 Try
711716
712- Dim ncxFilePath As String = "C:\Users\DataTrade\Downloads\QT\"
717+ Dim ncxFilePath As String = "C:\Users\DataTrade\Downloads\SB\"
713718
714719 Dim fs As System.IO.FileStream = New System.IO.FileStream(ncxFilePath & "toc.ncx", System.IO.FileMode.Open)
715720 Dim serializer As System.Xml.Serialization.XmlSerializer = New System.Xml.Serialization.XmlSerializer(GetType(ncx))
@@ -719,24 +724,16 @@
719724
720725 Dim mEpub As New List(Of modelVolume)
721726
722- For ctrVolume As Integer = 0 To fileNCX.navMap.Count - 1
723- Dim fileVoluem As ncxNavPoint = fileNCX.navMap(ctrVolume)
727+ For ctrVolume As Integer = 1 To fileNCX.navMap.Count - 1
724728 Dim mVolume As New modelVolume
725- mVolume.Title = fileVoluem.navLabel.text
726729
730+ If ctrVolume < 3 Then
727731
728- If fileVoluem.navPoint Is Nothing Then
732+ Dim fileVoluem As ncxNavPoint = fileNCX.navMap(ctrVolume)
733+ mVolume.Title = fileVoluem.navLabel.text
729734
730- Dim sChapter As String = cTools.sFileReader(ncxFilePath & fileVoluem.content.src, cEpub6.encUTF8)
735+ For ctrChapter As Integer = 1 To fileVoluem.navPoint.Length - 1
731736
732- Dim listText As List(Of String) = cTools.listText_P(sChapter)
733- mVolume.listText = listText
734-
735- Else
736-
737-
738- For ctrChapter As Integer = 0 To fileVoluem.navPoint.Length - 1
739-
740737 Dim fileChapter As ncxNavPointNavPoint = fileVoluem.navPoint(ctrChapter)
741738
742739 Dim mChapter As New modelChapter
@@ -744,29 +741,133 @@
744741 mChapter.Scr = fileChapter.content.src
745742 mChapter.Scr = mChapter.Scr.Split("#")(0)
746743
747- Dim sKey As Integer = cTools.listNav_SE(mChapter.Scr, "part", ".html", False)(0) + 1
744+ 'Dim sKey As Integer = cTools.listNav_SE(mChapter.Scr, "part", ".html", False)(0) + 1
745+ 'mChapter.Scr = "text/part" & sKey.ToString().PadLeft(4, "0") & ".html"
748746
749- mChapter.Scr = "text/part" & sKey.ToString().PadLeft(4, "0") & ".html"
750-
751747 Dim sChapter As String = cTools.sFileReader(ncxFilePath & mChapter.Scr, cEpub6.encUTF8)
752748
753- Dim listText As List(Of String) = cTools.listText_P(sChapter)
749+ ReplaceSpan(sChapter)
750+
751+ Dim listImg As List(Of String) = cTools.listNav_SE(sChapter, "<img", "/>", True)
752+ For Each uImg As String In listImg
753+ Dim sImgUrl As String = cTools.listNav_SE(uImg, "src=""", """/>", False)(0)
754+ If uImg.IndexOf("alone") > -1 Then
755+ Dim sImgKey As String = cTools.sMapImg(sImgUrl, emEpub6.emUrlImgDep.Volume)
756+ sChapter = sChapter.Replace(uImg, sImgKey)
757+ Else
758+ Dim sImgKey As String = cTools.sGaiji(sImgUrl, emEpub6.emUrlImgDep.Volume)
759+ sChapter = sChapter.Replace(uImg, sImgKey)
760+ End If
761+ Next
762+
763+ Dim listText As List(Of String) = cTools.listText_P(sChapter, listMobiRight, listRep)
754764 mChapter.listText = listText
755765 mVolume.listChapter.Add(mChapter)
756766
767+
768+
769+
757770 Next
758771
759772
773+ Else
774+
775+
776+ Dim fileVoluem As ncxNavPoint = fileNCX.navMap(ctrVolume)
777+ mVolume.Title = fileVoluem.navLabel.text
778+
779+ For ctrChapter As Integer = 1 To fileVoluem.navPoint.Length - 1
780+
781+ Dim fileChapterVV As ncxNavPointNavPoint = fileVoluem.navPoint(ctrChapter)
782+
783+ If ctrChapter < fileVoluem.navPoint.Length - 1 Then
784+
785+ For ctrChapter_sub As Integer = 0 To fileChapterVV.navPoint.Length - 1
786+
787+ Dim fileChapter As ncxNavPointNavPointNavPoint = fileChapterVV.navPoint(ctrChapter_sub)
788+
789+
790+
791+ Dim mChapter As New modelChapter
792+ mChapter.Title = fileChapter.navLabel.text
793+ mChapter.Scr = fileChapter.content.src
794+ mChapter.Scr = mChapter.Scr.Split("#")(0)
795+
796+ 'Dim sKey As Integer = cTools.listNav_SE(mChapter.Scr, "part", ".html", False)(0) + 1
797+ 'mChapter.Scr = "text/part" & sKey.ToString().PadLeft(4, "0") & ".html"
798+
799+ Dim sChapter As String = cTools.sFileReader(ncxFilePath & mChapter.Scr, cEpub6.encUTF8)
800+
801+ ReplaceSpan(sChapter)
802+
803+ Dim listImg As List(Of String) = cTools.listNav_SE(sChapter, "<img", "/>", True)
804+ For Each uImg As String In listImg
805+ Dim sImgUrl As String = cTools.listNav_SE(uImg, "src=""", """/>", False)(0)
806+ If uImg.IndexOf("alone") > -1 Then
807+ Dim sImgKey As String = cTools.sMapImg(sImgUrl, emEpub6.emUrlImgDep.Volume)
808+ sChapter = sChapter.Replace(uImg, sImgKey)
809+ Else
810+ Dim sImgKey As String = cTools.sGaiji(sImgUrl, emEpub6.emUrlImgDep.Volume)
811+ sChapter = sChapter.Replace(uImg, sImgKey)
812+ End If
813+ Next
814+
815+ Dim listText As List(Of String) = cTools.listText_P(sChapter, listMobiRight, listRep)
816+ mChapter.listText = listText
817+ mVolume.listChapter.Add(mChapter)
818+
819+
820+ Next
821+
822+ Else
823+
824+ Dim mChapter As New modelChapter
825+ mChapter.Title = fileChapterVV.navLabel.text
826+ mChapter.Scr = fileChapterVV.content.src
827+ mChapter.Scr = mChapter.Scr.Split("#")(0)
828+
829+ 'Dim sKey As Integer = cTools.listNav_SE(mChapter.Scr, "part", ".html", False)(0) + 1
830+ 'mChapter.Scr = "text/part" & sKey.ToString().PadLeft(4, "0") & ".html"
831+
832+ Dim sChapter As String = cTools.sFileReader(ncxFilePath & mChapter.Scr, cEpub6.encUTF8)
833+
834+ ReplaceSpan(sChapter)
835+
836+ Dim listImg As List(Of String) = cTools.listNav_SE(sChapter, "<img", "/>", True)
837+ For Each uImg As String In listImg
838+ Dim sImgUrl As String = cTools.listNav_SE(uImg, "src=""", """/>", False)(0)
839+ If uImg.IndexOf("alone") > -1 Then
840+ Dim sImgKey As String = cTools.sMapImg(sImgUrl, emEpub6.emUrlImgDep.Volume)
841+ sChapter = sChapter.Replace(uImg, sImgKey)
842+ Else
843+ Dim sImgKey As String = cTools.sGaiji(sImgUrl, emEpub6.emUrlImgDep.Volume)
844+ sChapter = sChapter.Replace(uImg, sImgKey)
845+ End If
846+ Next
847+
848+ Dim listText As List(Of String) = cTools.listText_P(sChapter, listMobiRight, listRep)
849+ mChapter.listText = listText
850+ mVolume.listChapter.Add(mChapter)
851+
852+ End If
853+
854+
855+
856+ Next
857+
858+
859+
760860 End If
761861
762862
763863
864+
764865 mEpub.Add(mVolume)
765866
766867 Next
767868
768869
769- Dim cEpub As New cEpub6(emEpub6.emEncCode.GB2321, emEpub6.emLan.ZH, "齐天传", "楚阳冬", "QTZ_202003")
870+ Dim cEpub As New cEpub6(emEpub6.emEncCode.GB2321, emEpub6.emLan.ZH, "司马辽太郎合集", "司马辽太郎", "SBL_202003")
770871 cEpub.bConvertToMobi = True
771872 cEpub.CreateEpub(mEpub)
772873 MessageBox.Show("Finished")
@@ -780,14 +881,31 @@
780881
781882 End Sub
782883
884+
885+ Public Sub ReplaceSpan(ByRef sHtml As String)
886+
887+ sHtml = sHtml.Replace("</span>", "")
888+ Dim listDelSpan As List(Of String) = cTools.listNav_SE(sHtml, "<span", ">", True)
889+ For Each delSpan As String In listDelSpan
890+ sHtml = sHtml.Replace(delSpan, "")
891+ Next
892+ End Sub
893+
894+
895+
896+
783897 Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
784898
899+ Dim listMobiRight As List(Of String) = {"bodytext-right"}.ToList()
900+
785901 Dim listError As New List(Of String)
786902 Dim sHtml As String = String.Empty
787903
904+ Dim listSkip As List(Of String) = {"版权信息", "目录"}.ToList
905+
788906 Try
789907
790- Dim ncxFilePath As String = "C:\Users\DataTrade\Downloads\XSS\OEBPS\"
908+ Dim ncxFilePath As String = "C:\Users\DataTrade\Downloads\MX\"
791909
792910 Dim fs As System.IO.FileStream = New System.IO.FileStream(ncxFilePath & "toc.ncx", System.IO.FileMode.Open)
793911 Dim serializer As System.Xml.Serialization.XmlSerializer = New System.Xml.Serialization.XmlSerializer(GetType(ncx))
@@ -797,7 +915,7 @@
797915
798916 Dim mEpub As New List(Of modelSection)
799917
800- For ctrSection As Integer = 0 To fileNCX.navMap.Count - 1
918+ For ctrSection As Integer = 2 To fileNCX.navMap.Count - 1
801919
802920 listError.Clear()
803921
@@ -806,6 +924,7 @@
806924 mSection.Title = fileSection.navLabel.text
807925 mSection.Scr = fileSection.content.src
808926
927+
809928 listError.Add(mSection.Title)
810929
811930
@@ -812,7 +931,7 @@
812931 If fileSection.navPoint Is Nothing Then
813932
814933 sHtml = cTools.sFileReader(ncxFilePath & mSection.Scr, cEpub6.encUTF8)
815- Dim listText As List(Of String) = cTools.listText_P(sHtml)
934+ Dim listText As List(Of String) = cTools.listText_P(sHtml, listMobiRight)
816935 mSection.listText = listText
817936
818937 Else
@@ -825,10 +944,19 @@
825944 mVolume.Scr = fileVoluem.content.src
826945 listError.Add("," & mVolume.Title)
827946
947+ If listSkip.Any(Function(x) mVolume.Title.IndexOf(x) > -1) Then
948+
949+ Continue For
950+
951+ End If
952+
953+
954+
955+
828956 If fileVoluem.navPoint Is Nothing Then
829957
830958 sHtml = cTools.sFileReader(ncxFilePath & mVolume.Scr, cEpub6.encUTF8)
831- Dim listText As List(Of String) = cTools.listText_P(sHtml)
959+ Dim listText As List(Of String) = cTools.listText_P(sHtml, listMobiRight)
832960 mVolume.listText = listText
833961
834962
@@ -846,7 +974,7 @@
846974
847975
848976 Dim sChapter As String = cTools.sFileReader(ncxFilePath & mChapter.Scr, cEpub6.encUTF8)
849- Dim listText As List(Of String) = cTools.listText_P(sChapter)
977+ Dim listText As List(Of String) = cTools.listText_P(sChapter, listMobiRight)
850978
851979 mChapter.listText = listText
852980
@@ -874,126 +1002,11 @@
8741002
8751003
8761004
877-
878-
879- ncxFilePath = "C:\Users\DataTrade\Downloads\XS\OEBPS\"
880-
881- fs = New System.IO.FileStream(ncxFilePath & "toc.ncx", System.IO.FileMode.Open)
882- serializer = New System.Xml.Serialization.XmlSerializer(GetType(ncx))
883- fileNCX = CType(serializer.Deserialize(fs), ncx)
884- fs.Dispose()
885-
886-
887- For ctrVolume As Integer = 14 To fileNCX.navMap.Count - 1
888- Dim fileVoluem As ncxNavPoint = fileNCX.navMap(ctrVolume)
889-
890- For ctrChapter As Integer = 0 To fileVoluem.navPoint.Length - 1
891-
892- Dim fileChapterFrom As ncxNavPointNavPoint = fileVoluem.navPoint(ctrChapter)
893-
894- Dim maddVolumn As New modelVolume
895- maddVolumn.Title = fileChapterFrom.navLabel.text
896- maddVolumn.Scr = fileChapterFrom.content.src
897-
898- Dim sChapter As String = String.Empty
899- If ctrChapter <> fileVoluem.navPoint.Length - 1 Then
900-
901- Dim fileChapterTo As ncxNavPointNavPoint = fileVoluem.navPoint(ctrChapter + 1)
902-
903- Dim iFrom As Integer = cTools.listNav_SE(maddVolumn.Scr, "part", ".xhtml", False)(0)
904- Dim iTo As Integer = cTools.listNav_SE(fileChapterTo.content.src, "part", ".xhtml", False)(0)
905-
906- Dim iiChapter As Integer = 0
907-
908- For iCtrL As Integer = iFrom To iTo - 1
909-
910- iiChapter += 1
911-
912- sChapter = cTools.sFileReader(ncxFilePath & "Text/part" & iCtrL.ToString().PadLeft(4, "0") & ".xhtml", cEpub6.encUTF8)
913-
914- Dim maddChap As New modelChapter
915- maddChap.Title = "第" & lbiCSharp.Tools.ToUpper(iiChapter) & "节"
916- sChapter = sChapter.Replace("<span style=""line-height: 1.618; text-indent: 2em;""><br/></span>", "")
917- sChapter = sChapter.Replace("<span style=""line-height: 1.618; text-indent: 2em;""></span>", "")
918-
919- sChapter = sChapter.Replace("<br/>", "")
920-
921-
922-
923-
924- Dim listRep As List(Of String) = cTools.listNav_SE(sChapter, "href=""", """>", False)
925- For Each eachRep As String In listRep
926- Dim listSplit As List(Of String) = eachRep.Split("#").ToList()
927- If listSplit.Count = 2 Then
928- sChapter = sChapter.Replace(eachRep, "#" & listSplit(1))
929- End If
930-
931- Next
932-
933- Dim listText As List(Of String) = cTools.listText_P(sChapter)
934- maddChap.listText = listText
935- maddVolumn.listChapter.Add(maddChap)
936-
937-
938-
939- Next
940-
941-
942- Else
943-
944- sChapter = cTools.sFileReader(ncxFilePath & maddVolumn.Scr, cEpub6.encUTF8)
945-
946- Dim listText As List(Of String) = cTools.listText_P(sChapter)
947- maddVolumn.listText = listText
948-
949-
950- 'Dim iFrom As Integer = cTools.listNav_SE(maddVolumn.Scr, "part", ".xhtml", False)(0)
951- 'sChapter = cTools.sFileReader(ncxFilePath & "Text/part" & iFrom.ToString().PadLeft(4, "0") & ".xhtml", cEpub6.encUTF8)
952-
953-
954- 'Dim maddChap As New modelChapter
955- 'maddChap.Title = "第" & lbiCSharp.Tools.ToUpper(ctrChapter + 1) & "节"
956- 'sChapter = sChapter.Replace("<span style=""line-height: 1.618; text-indent: 2em;""><br/></span>", "")
957- 'sChapter = sChapter.Replace("<span style=""line-height: 1.618; text-indent: 2em;""></span>", "")
958- 'Dim listRep As List(Of String) = cTools.listNav_SE(sChapter, "href=""", """>", False)
959- 'For Each eachRep As String In listRep
960- ' Dim listSplit As List(Of String) = eachRep.Split("#").ToList()
961- ' If listSplit.Count = 2 Then
962- ' sChapter = sChapter.Replace(eachRep, "#" & listSplit(1))
963- ' End If
964- 'Next
965-
966- 'Dim listText As List(Of String) = cTools.listText_P(sChapter)
967- 'maddChap.listText = listText
968- 'maddVolumn.listChapter.Add(maddChap)
969-
970-
971-
972-
973- End If
974-
975-
976- mEpub(mEpub.Count - 1).listVolume.Insert(mEpub(mEpub.Count - 1).listVolume.Count - 1, maddVolumn)
977- Next
978-
979-
980-
981-
982- Next
983-
984-
985-
986- mEpub.RemoveAt(3)
987- mEpub.RemoveAt(2)
988- mEpub.RemoveAt(0)
989-
990- mEpub(2).listVolume.RemoveAt(11)
991-
992-
993- Dim cEpub As New cEpub6(emEpub6.emEncCode.GB2321, emEpub6.emLan.ZH, "新宋", "阿越", "XS_202003")
994- cEpub.bConvertToMobi = True
1005+ Dim cEpub As New cEpub6(emEpub6.emEncCode.GB2321, emEpub6.emLan.ZH, "米歇尔·普西犯罪悬疑小说集", "米歇尔·普西", "MXEPX_202003")
1006+ cEpub.bConvertToMobi = False
9951007 cEpub.CreateEpub(mEpub)
9961008 MessageBox.Show("Finished")
1009+ System.Diagnostics.Process.Start(cEpub.sOutPutPathFolder)
9971010
9981011
9991012 Catch ex As Exception
@@ -1082,105 +1095,100 @@
10821095
10831096 Private Sub Button8_Click(sender As Object, e As EventArgs) Handles Button8.Click
10841097
1085- Dim listError As New List(Of String)
1086-
1087- Dim ikke As Integer = 0
1088-
10891098 Try
10901099
1091- Dim ncxFilePath As String = "C:\Users\DataTrade\Downloads\cdcd1\OEBPS\toc.ncx"
1100+ Dim ncxFilePath As String = "C:\Users\DataTrade\Downloads\QT\"
10921101
1093- Dim fs As System.IO.FileStream = New System.IO.FileStream(ncxFilePath, System.IO.FileMode.Open)
1102+ Dim fs As System.IO.FileStream = New System.IO.FileStream(ncxFilePath & "toc.ncx", System.IO.FileMode.Open)
10941103 Dim serializer As System.Xml.Serialization.XmlSerializer = New System.Xml.Serialization.XmlSerializer(GetType(ncx))
10951104 Dim fileNCX As ncx = CType(serializer.Deserialize(fs), ncx)
10961105 fs.Dispose()
10971106
1107+
10981108 Dim mEpub As New List(Of modelSection)
10991109
1100- Dim listNav As List(Of ncxNavPoint) = fileNCX.navMap.ToList()
1101- Dim linqSection = From dtSeq In listNav Where dtSeq.navLabel.text.IndexOf("大唐辟邪司") > -1
1110+ For ctrVolume As Integer = 0 To fileNCX.navMap.Count - 1
1111+ Dim fileVoluem As ncxNavPoint = fileNCX.navMap(ctrVolume)
1112+ Dim mSection As New modelSection
1113+ mSection.Title = fileVoluem.navLabel.text
11021114
1103- For iCtrSection As Integer = 0 To 2
1104- Dim dSectionFrom As Decimal = listNav.IndexOf(linqSection(iCtrSection))
1105- Dim dSectionTo As Decimal = listNav.Count - 1
11061115
1107- If iCtrSection < 2 Then
1108- dSectionTo = listNav.IndexOf(linqSection(iCtrSection + 1)) - 1
1109- End If
1116+ If fileVoluem.navPoint Is Nothing Then
11101117
1111- Dim mSection As New modelSection
1112- mSection.Title = listNav(dSectionFrom).navLabel.text
1118+ Dim sChapter As String = cTools.sFileReader(ncxFilePath & fileVoluem.content.src, cEpub6.encUTF8)
11131119
1114- mSection.Title = mSection.Title.Replace("大唐辟邪司", "")
1120+ Dim listText As List(Of String) = cTools.listText_P(sChapter)
1121+ mSection.listText = listText
11151122
1116- mSection.Title = mSection.Title.Replace("III:", "第叁册 ")
1117- mSection.Title = mSection.Title.Replace("II:", "第贰册 ")
1118- mSection.Title = mSection.Title.Replace("I:", "第壹册 ")
1123+ Else
11191124
1120- Dim listTargetSec As New List(Of ncxNavPoint)
11211125
1122- Dim linqVoluem = From dtSeq In listNav Where dtSeq.navLabel.text.IndexOf("卷") > -1
1126+ For ctrChapter As Integer = 0 To fileVoluem.navPoint.Length - 1
11231127
1128+ Dim fileChapter As ncxNavPointNavPoint = fileVoluem.navPoint(ctrChapter)
11241129
1125- For iCtrVoluen As Integer = 0 To 1
1130+ Dim mVolume As New modelVolume
1131+ mVolume.Title = fileChapter.navLabel.text
1132+ mVolume.Scr = fileChapter.content.src
1133+ mVolume.Scr = mVolume.Scr.Split("#")(0)
11261134
1127- Dim dVoluenFrom As Decimal = listNav.IndexOf(linqVoluem(iCtrVoluen + ikke))
1128- Dim dVoluenTo As Decimal = dSectionTo
1135+ Dim sKey As Integer = cTools.listNav_SE(mVolume.Scr, "part", ".html", False)(0) + 1
11291136
1130- If iCtrVoluen < 1 Then
1131- dVoluenTo = listNav.IndexOf(linqVoluem(iCtrVoluen + 1 + ikke)) - 1
1132- End If
1137+ mVolume.Scr = "text/part" & sKey.ToString().PadLeft(4, "0") & ".html"
11331138
1134- Dim mVolume As New modelVolume
1135- mVolume.Title = listNav(dVoluenFrom).navLabel.text
1136- listError.Add("," & mVolume.Title)
1139+ Dim sVolume As String = cTools.sFileReader(ncxFilePath & mVolume.Scr, cEpub6.encUTF8)
11371140
1138- For iCtrChapter As Integer = dVoluenFrom + 1 To dVoluenTo
1141+ sVolume = sVolume.Replace("<br class=""calibre3""/>", "")
11391142
1140- Dim mChapter As New modelChapter
1141- mChapter.Title = listNav(iCtrChapter).navLabel.text
1143+ Dim listText As List(Of String) = cTools.listText_P(sVolume)
11421144
1143- If mChapter.Title.IndexOf("章节") > -1 Then
1145+ Dim linqVolue As List(Of String) = listText.Where(Function(x) x.Trim.Length = 3).ToList
11441146
1145- mChapter.Title = mChapter.Title.Replace("章节", "第")
1146- mChapter.Title = mChapter.Title.Replace(" ", "章 ")
11471147
1148+ Dim linqVolueCHK As List(Of String) = linqVolue.Where(Function(x) x.Replace("!", "").Replace(",", "").Replace("。", "").Replace("?", "").Trim.Length = 3).ToList
11481149
1149- End If
1150+ For iCAP As Integer = 0 To linqVolueCHK.Count - 1
11501151
1152+ Dim sNameNUM As String = "第" & lbiCSharp.Tools.ToUpper(iCAP + 1) & "节 "
11511153
1154+ If iCAP < linqVolueCHK.Count - 1 Then
11521155
1156+ Dim mChapter As New modelChapter
1157+ mChapter.Title = sNameNUM & linqVolueCHK(iCAP)
1158+ mChapter.Scr = fileChapter.content.src
1159+ Dim sChapter As String = cTools.listNav_SE(sVolume, linqVolueCHK(iCAP) & "</p>", linqVolueCHK(iCAP + 1) & "</p>", False)(0)
1160+ listText = cTools.listText_P(sChapter)
1161+ mChapter.listText = listText
1162+ mVolume.listChapter.Add(mChapter)
11531163
1154- mChapter.Scr = listNav(iCtrChapter).content.src
1155- listError.Add("," & mChapter.Title)
1164+ Else
11561165
11571166
1158- Dim listScr As List(Of String) = mChapter.Scr.Split("#").ToList()
1159- Dim sScr01 As String = mChapter.Scr.Split("#")(0)
1160- Dim sScr02 As String = "640401"
1167+ Dim mChapter As New modelChapter
1168+ mChapter.Title = sNameNUM & linqVolueCHK(iCAP)
1169+ mChapter.Scr = fileChapter.content.src
1170+ Dim sChapter As String = cTools.listNav_SE(sVolume, linqVolueCHK(iCAP) & "</p>", False)(0)
1171+ listText = cTools.listText_P(sChapter)
1172+ mChapter.listText = listText
1173+ mVolume.listChapter.Add(mChapter)
11611174
1162- If listScr.Count > 1 Then
1163- sScr02 = mChapter.Scr.Split("#")(1)
1164- End If
11651175
1176+ End If
11661177
1167- Dim sChapter As String = cTools.sFileReader("C:\Users\DataTrade\Downloads\cdcd1\OEBPS\" & sScr01, cEpub6.encUTF8)
11681178
1169- Dim listChapter As List(Of String) = sChapter.Split({"<span id="}, StringSplitOptions.None).ToList().Where(Function(x) x.IndexOf(sScr02) > -1).ToList()
1179+ Next
11701180
1171- Dim listText As List(Of String) = cTools.listText_P(listChapter(0))
1181+ 'Dim listText As List(Of String) = cTools.listText_P(sChapter)
1182+ 'mChapter.listText = listText
1183+ 'mVolume.listChapter.Add(mChapter)
11721184
1185+ mSection.listVolume.Add(mVolume)
11731186
1174- mChapter.listText = listText
1175-
1176- mVolume.listChapter.Add(mChapter)
11771187 Next
11781188
1179- mSection.listVolume.Add(mVolume)
11801189
1181- Next
1190+ End If
11821191
1183- ikke += 2
11841192
11851193 mEpub.Add(mSection)
11861194
@@ -1187,33 +1195,16 @@
11871195 Next
11881196
11891197
1190-
1191- Dim addSection As New modelSection
1192-
1193- Dim dTarget As Decimal = mEpub(2).listVolume(1).listChapter.Count - 1
1194- addSection.Title = mEpub(2).listVolume(1).listChapter(dTarget).Title
1195- addSection.listText = mEpub(2).listVolume(1).listChapter(dTarget).listText
1196-
1197- addSection.listText.RemoveAt(0)
1198-
1199- addSection.listText.RemoveRange(addSection.listText.Count - 4, 4)
1200-
1201- mEpub(2).listVolume(1).listChapter.RemoveAt(dTarget)
1202- mEpub.Add(addSection)
1203-
1204-
1205- Dim cEpub As New cEpub6(emEpub6.emEncCode.GB2321, emEpub6.emLan.ZH, "大唐辟邪司", "王晴川", "DTPXS_202002")
1206- cEpub.bConvertToMobi = True
1198+ Dim cEpub As New cEpub6(emEpub6.emEncCode.GB2321, emEpub6.emLan.ZH, "齐天传", "楚阳冬", "QTZ_202003")
1199+ cEpub.bConvertToMobi = False
12071200 cEpub.CreateEpub(mEpub)
12081201 MessageBox.Show("Finished")
1202+ System.Diagnostics.Process.Start(cEpub.sOutPutPathFolder)
12091203
1210-
12111204 Catch ex As Exception
12121205
12131206 MessageBox.Show(ex.Message)
12141207
1215- Dim k1 = listError
1216-
12171208 End Try
12181209
12191210
--- AutoEpub3/cTools.vb (revision 356)
+++ AutoEpub3/cTools.vb (revision 357)
@@ -93,6 +93,9 @@
9393
9494 Public Shared Function sFileReader(ByVal sPatch As String, ByVal enc As Encoding) As String
9595
96+ sPatch = sPatch.Split("#")(0)
97+
98+
9699 sFileReader = String.Empty
97100 Dim sr As New StreamReader(sPatch, enc)
98101 Try
Show on old repository browser