• R/O
  • SSH
  • HTTPS

autocodeforsql: Commit


Commit MetaInfo

Révision360 (tree)
l'heure2020-05-26 17:38:08
Auteurhilinwei

Message de Log

Change Summary

Modification

--- AutoEpub3/AutoEpub7.Designer.vb (revision 359)
+++ AutoEpub3/AutoEpub7.Designer.vb (revision 360)
@@ -33,12 +33,16 @@
3333 Me.Button8 = New System.Windows.Forms.Button()
3434 Me.Button9 = New System.Windows.Forms.Button()
3535 Me.btnReName = New System.Windows.Forms.Button()
36+ Me.Button10 = New System.Windows.Forms.Button()
37+ Me.Button11 = New System.Windows.Forms.Button()
38+ Me.Button12 = New System.Windows.Forms.Button()
39+ Me.Button13 = New System.Windows.Forms.Button()
3640 Me.SuspendLayout()
3741 '
3842 'btnNCXDep2
3943 '
4044 Me.btnNCXDep2.Location = New System.Drawing.Point(60, 52)
41- Me.btnNCXDep2.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4)
45+ Me.btnNCXDep2.Margin = New System.Windows.Forms.Padding(4)
4246 Me.btnNCXDep2.Name = "btnNCXDep2"
4347 Me.btnNCXDep2.Size = New System.Drawing.Size(231, 86)
4448 Me.btnNCXDep2.TabIndex = 10
@@ -48,7 +52,7 @@
4852 'Button1
4953 '
5054 Me.Button1.Location = New System.Drawing.Point(60, 191)
51- Me.Button1.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4)
55+ Me.Button1.Margin = New System.Windows.Forms.Padding(4)
5256 Me.Button1.Name = "Button1"
5357 Me.Button1.Size = New System.Drawing.Size(231, 86)
5458 Me.Button1.TabIndex = 11
@@ -58,7 +62,7 @@
5862 'Button2
5963 '
6064 Me.Button2.Location = New System.Drawing.Point(60, 310)
61- Me.Button2.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4)
65+ Me.Button2.Margin = New System.Windows.Forms.Padding(4)
6266 Me.Button2.Name = "Button2"
6367 Me.Button2.Size = New System.Drawing.Size(231, 86)
6468 Me.Button2.TabIndex = 12
@@ -68,7 +72,7 @@
6872 'Button3
6973 '
7074 Me.Button3.Location = New System.Drawing.Point(315, 191)
71- Me.Button3.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4)
75+ Me.Button3.Margin = New System.Windows.Forms.Padding(4)
7276 Me.Button3.Name = "Button3"
7377 Me.Button3.Size = New System.Drawing.Size(231, 86)
7478 Me.Button3.TabIndex = 13
@@ -78,7 +82,7 @@
7882 'Button4
7983 '
8084 Me.Button4.Location = New System.Drawing.Point(573, 310)
81- Me.Button4.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4)
85+ Me.Button4.Margin = New System.Windows.Forms.Padding(4)
8286 Me.Button4.Name = "Button4"
8387 Me.Button4.Size = New System.Drawing.Size(231, 86)
8488 Me.Button4.TabIndex = 14
@@ -88,7 +92,7 @@
8892 'Button5
8993 '
9094 Me.Button5.Location = New System.Drawing.Point(299, 52)
91- Me.Button5.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4)
95+ Me.Button5.Margin = New System.Windows.Forms.Padding(4)
9296 Me.Button5.Name = "Button5"
9397 Me.Button5.Size = New System.Drawing.Size(231, 86)
9498 Me.Button5.TabIndex = 15
@@ -98,7 +102,7 @@
98102 'Button6
99103 '
100104 Me.Button6.Location = New System.Drawing.Point(556, 52)
101- Me.Button6.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4)
105+ Me.Button6.Margin = New System.Windows.Forms.Padding(4)
102106 Me.Button6.Name = "Button6"
103107 Me.Button6.Size = New System.Drawing.Size(231, 86)
104108 Me.Button6.TabIndex = 16
@@ -108,7 +112,7 @@
108112 'Button7
109113 '
110114 Me.Button7.Location = New System.Drawing.Point(60, 420)
111- Me.Button7.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4)
115+ Me.Button7.Margin = New System.Windows.Forms.Padding(4)
112116 Me.Button7.Name = "Button7"
113117 Me.Button7.Size = New System.Drawing.Size(231, 86)
114118 Me.Button7.TabIndex = 17
@@ -118,7 +122,7 @@
118122 'Button8
119123 '
120124 Me.Button8.Location = New System.Drawing.Point(573, 191)
121- Me.Button8.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4)
125+ Me.Button8.Margin = New System.Windows.Forms.Padding(4)
122126 Me.Button8.Name = "Button8"
123127 Me.Button8.Size = New System.Drawing.Size(231, 86)
124128 Me.Button8.TabIndex = 18
@@ -128,7 +132,7 @@
128132 'Button9
129133 '
130134 Me.Button9.Location = New System.Drawing.Point(315, 310)
131- Me.Button9.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4)
135+ Me.Button9.Margin = New System.Windows.Forms.Padding(4)
132136 Me.Button9.Name = "Button9"
133137 Me.Button9.Size = New System.Drawing.Size(231, 86)
134138 Me.Button9.TabIndex = 19
@@ -137,7 +141,7 @@
137141 '
138142 'btnReName
139143 '
140- Me.btnReName.Location = New System.Drawing.Point(808, 451)
144+ Me.btnReName.Location = New System.Drawing.Point(610, 420)
141145 Me.btnReName.Margin = New System.Windows.Forms.Padding(4)
142146 Me.btnReName.Name = "btnReName"
143147 Me.btnReName.Size = New System.Drawing.Size(231, 86)
@@ -145,11 +149,55 @@
145149 Me.btnReName.Text = "ReName"
146150 Me.btnReName.UseVisualStyleBackColor = True
147151 '
152+ 'Button10
153+ '
154+ Me.Button10.Location = New System.Drawing.Point(831, 52)
155+ Me.Button10.Margin = New System.Windows.Forms.Padding(4)
156+ Me.Button10.Name = "Button10"
157+ Me.Button10.Size = New System.Drawing.Size(231, 86)
158+ Me.Button10.TabIndex = 21
159+ Me.Button10.Text = "JsonEdit"
160+ Me.Button10.UseVisualStyleBackColor = True
161+ '
162+ 'Button11
163+ '
164+ Me.Button11.Location = New System.Drawing.Point(315, 420)
165+ Me.Button11.Margin = New System.Windows.Forms.Padding(4)
166+ Me.Button11.Name = "Button11"
167+ Me.Button11.Size = New System.Drawing.Size(231, 86)
168+ Me.Button11.TabIndex = 22
169+ Me.Button11.Text = "Txt Dep 1"
170+ Me.Button11.UseVisualStyleBackColor = True
171+ '
172+ 'Button12
173+ '
174+ Me.Button12.Location = New System.Drawing.Point(924, 234)
175+ Me.Button12.Margin = New System.Windows.Forms.Padding(4)
176+ Me.Button12.Name = "Button12"
177+ Me.Button12.Size = New System.Drawing.Size(115, 86)
178+ Me.Button12.TabIndex = 23
179+ Me.Button12.Text = "NCX Dep 2 B"
180+ Me.Button12.UseVisualStyleBackColor = True
181+ '
182+ 'Button13
183+ '
184+ Me.Button13.Location = New System.Drawing.Point(924, 374)
185+ Me.Button13.Margin = New System.Windows.Forms.Padding(4)
186+ Me.Button13.Name = "Button13"
187+ Me.Button13.Size = New System.Drawing.Size(115, 86)
188+ Me.Button13.TabIndex = 24
189+ Me.Button13.Text = "Fore 2020"
190+ Me.Button13.UseVisualStyleBackColor = True
191+ '
148192 'AutoEpub7
149193 '
150194 Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 15.0!)
151195 Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
152196 Me.ClientSize = New System.Drawing.Size(1084, 562)
197+ Me.Controls.Add(Me.Button13)
198+ Me.Controls.Add(Me.Button12)
199+ Me.Controls.Add(Me.Button11)
200+ Me.Controls.Add(Me.Button10)
153201 Me.Controls.Add(Me.btnReName)
154202 Me.Controls.Add(Me.Button9)
155203 Me.Controls.Add(Me.Button8)
@@ -161,7 +209,7 @@
161209 Me.Controls.Add(Me.Button2)
162210 Me.Controls.Add(Me.Button1)
163211 Me.Controls.Add(Me.btnNCXDep2)
164- Me.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4)
212+ Me.Margin = New System.Windows.Forms.Padding(4)
165213 Me.Name = "AutoEpub7"
166214 Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
167215 Me.Text = "AutoEpub7"
@@ -180,4 +228,8 @@
180228 Friend WithEvents Button8 As Button
181229 Friend WithEvents Button9 As Button
182230 Friend WithEvents btnReName As Button
231+ Friend WithEvents Button10 As Button
232+ Friend WithEvents Button11 As Button
233+ Friend WithEvents Button12 As Button
234+ Friend WithEvents Button13 As Button
183235 End Class
--- AutoEpub3/AutoEpub7.vb (revision 359)
+++ AutoEpub3/AutoEpub7.vb (revision 360)
@@ -1,5 +1,7 @@
11 
22
3+Imports System.IO
4+Imports Newtonsoft.Json
35 Imports ExcelApplication = Microsoft.Office.Interop.Excel.Application
46
57
@@ -714,7 +716,7 @@
714716
715717 Try
716718
717- Dim ncxFilePath As String = "C:\Users\DTC_PC07\Downloads\NZ\"
719+ Dim ncxFilePath As String = "C:\Users\DTC_PC07\Downloads\JL\"
718720
719721 Dim fs As System.IO.FileStream = New System.IO.FileStream(ncxFilePath & "toc.ncx", System.IO.FileMode.Open)
720722 Dim serializer As System.Xml.Serialization.XmlSerializer = New System.Xml.Serialization.XmlSerializer(GetType(ncx))
@@ -765,15 +767,7 @@
765767 mChapter.Scr = fileChapter.content.src
766768 mChapter.Scr = mChapter.Scr.Split("#")(0)
767769
768- If mChapter.Title.IndexOf("王六郎") = -1 Then
769- Continue For
770- End If
771770
772-
773-
774- 'Dim sKey As Integer = cTools.listNav_SE(mChapter.Scr, "part", ".html", False)(0) + 1
775- 'mChapter.Scr = "text/part" & sKey.ToString().PadLeft(4, "0") & ".html"
776-
777771 Dim sChapter As String = cTools.sFileReader(ncxFilePath & mChapter.Scr, cEpub6.encUTF8)
778772
779773
@@ -1277,5 +1271,283 @@
12771271
12781272 End Sub
12791273
1274+ Private Sub Button10_Click(sender As Object, e As EventArgs) Handles Button10.Click
12801275
1276+ Dim sJson As String = cTools.sFileReader("D:\Soft\Json\Edit\B1.txt", cEpub6.encShift_JIS)
1277+ Dim mEpub As List(Of modelVolume) = JsonConvert.DeserializeObject(sJson, GetType(List(Of modelVolume)))
1278+
1279+ For iCtrVolume As Integer = 5 To mEpub.Count - 1
1280+
1281+ Dim emVolume As modelVolume = mEpub(iCtrVolume)
1282+
1283+ For iCtrChapter As Integer = 0 To emVolume.listChapter.Count - 1
1284+
1285+ Dim emChapter As modelChapter = emVolume.listChapter(iCtrChapter)
1286+
1287+
1288+ For iCtrLine As Integer = 0 To emChapter.listText.Count - 1
1289+ Dim listEditSp As List(Of String) = cTools.listNav_SE(emChapter.listText(iCtrLine), "<a id", "</sup></a>", True)
1290+
1291+ For Each editLine As String In listEditSp
1292+
1293+ Dim sKey1 As String = cTools.listNav_SE(editLine, "id=""", """><", False)(0)
1294+ Dim sKey2 As String = cTools.listNav_SE(editLine, "href=""", """><", False)(0)
1295+ Dim sKey3 As String = cTools.listNav_SE(editLine, "e7"">", "</sup>", False)(0)
1296+
1297+ Dim sKeyReal As String = "<a id=""" & sKey1 & """ href=""" & sKey2 & """><sup class=""calibre7"">" & sKey3 & "</sup></a>"
1298+
1299+ mEpub(iCtrVolume).listChapter(iCtrChapter).listText(iCtrLine) = mEpub(iCtrVolume).listChapter(iCtrChapter).listText(iCtrLine).Replace(editLine, sKeyReal)
1300+
1301+ Next
1302+
1303+
1304+ Next
1305+
1306+
1307+
1308+
1309+ Next
1310+
1311+
1312+ Next
1313+
1314+
1315+
1316+
1317+ Dim mEpub5 As New List(Of modelVolume)
1318+ mEpub5.Add(mEpub(5))
1319+
1320+
1321+ Dim cEpub As New cEpub6(emEpub6.emEncCode.GB2321, emEpub6.emLan.ZH, "聊斋志异详注新评222", "蒲松龄", "H_NZ_202004")
1322+ cEpub.bConvertToMobi = True
1323+ cEpub.CreateEpub(mEpub5)
1324+ MessageBox.Show("Finished")
1325+ System.Diagnostics.Process.Start(cEpub.sOutPutPathFolder)
1326+
1327+
1328+
1329+
1330+ End Sub
1331+
1332+ Private Sub Button11_Click(sender As Object, e As EventArgs) Handles Button11.Click
1333+
1334+ Dim sHtml As String = cTools.sFileReader("C:\Users\DTC_PC07\Downloads\WW1.txt", cEpub6.encGB2321)
1335+
1336+ sHtml = sHtml.Replace("*******", "")
1337+ sHtml = sHtml.Replace("******", "")
1338+
1339+ sHtml = sHtml.Replace(" ", " ")
1340+
1341+
1342+
1343+
1344+ Dim listChapter As List(Of String) = sHtml.Split({vbCrLf & vbCrLf}, StringSplitOptions.None).ToList
1345+
1346+ listChapter.RemoveAt(0)
1347+
1348+ Dim mEpub As New List(Of modelChapter)
1349+
1350+
1351+ For Each sChpater As String In listChapter
1352+
1353+ Dim listLine As List(Of String) = sChpater.Split({vbCrLf}, StringSplitOptions.None).ToList
1354+
1355+ Dim uChpater As New modelChapter
1356+
1357+ Dim sKe As List(Of String) = listLine(1).Split(" ").ToList
1358+ sKe.RemoveAt(1)
1359+
1360+
1361+ uChpater.Title = String.Join(" ", sKe)
1362+
1363+ listLine.RemoveRange(0, 2)
1364+
1365+ uChpater.listText = listLine
1366+ mEpub.Add(uChpater)
1367+
1368+
1369+ Next
1370+
1371+ Dim cEpub As New cEpub6(emEpub6.emEncCode.GB2321, emEpub6.emLan.ZH, "乌衣巷", "闫灵", "WYX_202004")
1372+ cEpub.bConvertToMobi = True
1373+ cEpub.CreateEpub(mEpub)
1374+ MessageBox.Show("Finished")
1375+ System.Diagnostics.Process.Start(cEpub.sOutPutPathFolder)
1376+
1377+ End Sub
1378+
1379+ Private Sub Button12_Click(sender As Object, e As EventArgs) Handles Button12.Click
1380+
1381+ Dim sText As String = String.Empty
1382+ Dim listLine As New List(Of String)
1383+ Dim listSkip As New List(Of String)
1384+
1385+
1386+
1387+ Dim bookPath As String = "C:\Users\DTC_PC07\Downloads\JL\"
1388+ Dim ncxFilePath As String = Path.Combine(bookPath, "toc.ncx")
1389+
1390+ Dim fs As System.IO.FileStream = New System.IO.FileStream(ncxFilePath, System.IO.FileMode.Open)
1391+ Dim serializer As System.Xml.Serialization.XmlSerializer = New System.Xml.Serialization.XmlSerializer(GetType(ncx))
1392+ Dim model As ncx = CType(serializer.Deserialize(fs), ncx)
1393+
1394+ Dim mEpub As New List(Of modelVolume)
1395+
1396+ For iCtr As Integer = 0 To 0
1397+ Dim unitOne As ncxNavPoint = model.navMap(iCtr)
1398+ Dim unitVolume As New modelVolume
1399+ unitVolume.Title = unitOne.navLabel.text
1400+
1401+ If unitOne.navPoint Is Nothing Then
1402+
1403+ Dim sHtml As String = cTools.sFileReader(bookPath & unitOne.content.src, cEpub6.encUTF8)
1404+
1405+ Else
1406+
1407+ For Each eachNax As ncxNavPointNavPoint In unitOne.navPoint
1408+
1409+ Dim sPath As String = (bookPath & eachNax.content.src).Split("#").ToList(0)
1410+
1411+ Dim mChapter As New modelChapter
1412+ mChapter.Title = eachNax.navLabel.text
1413+ Dim sHtml As String = cTools.sFileReader(sPath, cEpub6.encUTF8)
1414+
1415+ Dim listChapterLine As List(Of String) = cTools.listText_P(sHtml)
1416+ mChapter.listText = listChapterLine
1417+
1418+ If mChapter.Title.IndexOf("感言") > -1 Then
1419+ Continue For
1420+ End If
1421+
1422+ If mChapter.Title.IndexOf("版权信息") > -1 Then
1423+ unitVolume.Title = listChapterLine(0).Split("·")(1)
1424+
1425+ Else
1426+ unitVolume.listChapter.Add(mChapter)
1427+ End If
1428+
1429+
1430+ Next
1431+
1432+ End If
1433+
1434+ mEpub.Add(unitVolume)
1435+
1436+ Next
1437+
1438+
1439+ Dim cEpub As New cEpub6(emEpub6.emEncCode.SHIFT_JIS, emEpub6.emLan.ZH, "剑来", "烽火戏诸侯", "JL_202005")
1440+ cEpub.bConvertToMobi = True
1441+
1442+ cEpub.CreateEpub(mEpub)
1443+ MessageBox.Show("Finished")
1444+
1445+
1446+ End Sub
1447+
1448+ Private Sub Button13_Click(sender As Object, e As EventArgs) Handles Button13.Click
1449+ Dim bookPath As String = "C:\Users\DTC_PC07\Downloads\sdmMM\"
1450+ Dim ncxFilePath As String = Path.Combine(bookPath, "toc.ncx")
1451+
1452+ Dim fs As System.IO.FileStream = New System.IO.FileStream(ncxFilePath, System.IO.FileMode.Open)
1453+ Dim serializer As System.Xml.Serialization.XmlSerializer = New System.Xml.Serialization.XmlSerializer(GetType(ncx))
1454+ Dim model As ncx = CType(serializer.Deserialize(fs), ncx)
1455+
1456+ Dim mEpub As New List(Of modelChapter)
1457+
1458+ For iCtr As Integer = 1 To 2
1459+ Dim unitOne As ncxNavPoint = model.navMap(iCtr)
1460+
1461+
1462+ If unitOne.navPoint Is Nothing Then
1463+
1464+ Dim sHtml As String = cTools.sFileReader(bookPath & unitOne.content.src, cEpub6.encUTF8)
1465+
1466+ Else
1467+
1468+ For Each eachNax As ncxNavPointNavPoint In unitOne.navPoint
1469+
1470+ Dim sPath As String = (bookPath & eachNax.content.src).Split("#").ToList(0)
1471+
1472+ Dim mChapter As New modelChapter
1473+
1474+ mChapter.Title = eachNax.navLabel.text
1475+ Dim sHtml As String = cTools.sFileReader(sPath, cEpub6.encUTF8)
1476+
1477+ If sHtml.IndexOf("h1") > -1 Then
1478+ Dim sTitle As String = cTools.listNav_SE(sHtml, "<h1", "</h1>", True)(0)
1479+ If sTitle.IndexOf("href") > -1 Then
1480+ Dim listHref As List(Of String) = cTools.listNav_SE(sTitle, "href=""", """>", True)
1481+ For Each eachHref As String In listHref
1482+ Dim sKey As String = eachHref.Split("#")(1).Replace(""">", "")
1483+ sTitle = sTitle.Replace(eachHref, "href=""#" & sKey & """>")
1484+ Next
1485+ mChapter.TitleSP = mChapter.Title & "<a" & cTools.listNav_SE(sTitle, "<a", "</h1>", False)(0)
1486+ End If
1487+ End If
1488+
1489+
1490+
1491+
1492+
1493+ Dim listHref_Titl As List(Of String) = cTools.listNav_SE(sHtml, "<a href", """>", True).Where(Function(x) x.IndexOf("#") > -1).ToList()
1494+
1495+
1496+ For Each uHref As String In listHref_Titl
1497+
1498+ Dim sKeyHref As String = uHref.Split("#")(1).Split("""")(0)
1499+
1500+ sHtml = sHtml.Replace(uHref, "<a href=""#" & sKeyHref & """>")
1501+
1502+ Next
1503+
1504+
1505+
1506+
1507+
1508+
1509+
1510+ Dim listImg As List(Of String) = cTools.listNav_SE(sHtml, "<img", "/>", True)
1511+
1512+ For Each uImg As String In listImg
1513+ Dim sImgUrl As String = cTools.listNav_SE(uImg, "src=""", """/>", False)(0)
1514+ If uImg.IndexOf("alone") > -1 Then
1515+ Dim sImgKey As String = cTools.sMapImg(sImgUrl, emEpub6.emUrlImgDep.Chapter)
1516+ sHtml = sHtml.Replace(uImg, sImgKey)
1517+ Else
1518+ Dim sImgKey As String = cTools.sGaiji(sImgUrl, emEpub6.emUrlImgDep.Chapter)
1519+ sHtml = sHtml.Replace(uImg, sImgKey)
1520+ End If
1521+ Next
1522+
1523+
1524+
1525+
1526+ Dim listChapterLine As List(Of String) = cTools.listText_P(sHtml)
1527+ mChapter.listText = listChapterLine
1528+
1529+ mEpub.Add(mChapter)
1530+
1531+
1532+ Next
1533+
1534+ End If
1535+
1536+
1537+
1538+ Next
1539+
1540+
1541+ Dim cEpub As New cEpub6(emEpub6.emEncCode.SHIFT_JIS, emEpub6.emLan.ZH, "红楼梦", "曹雪芹", "SDMZ_HLM_202005")
1542+ cEpub.bConvertToMobi = False
1543+
1544+ cEpub.CreateEpub(mEpub)
1545+ MessageBox.Show("Finished")
1546+ System.Diagnostics.Process.Start(cEpub.sOutPutPathFolder)
1547+
1548+
1549+
1550+ End Sub
1551+
1552+
12811553 End Class
\ No newline at end of file
--- AutoEpub3/Files/OEBPS/stylesheet.css (revision 359)
+++ AutoEpub3/Files/OEBPS/stylesheet.css (revision 360)
@@ -213,6 +213,21 @@
213213 width: 1em;
214214 padding-bottom :5px;
215215 }
216+
217+.mobiImgChar_inline {
218+ height: 1em;
219+ margin-bottom: -0.1em;
220+ width: auto
221+}
222+
223+.mobiImgChar_inline1 {
224+ height: 1em;
225+ line-height: 1.2;
226+ margin-bottom: -0.1em;
227+ width: auto
228+}
229+
230+
216231 span.notes {font-size: smaller}
217232 img.gaiji { width: 1em; height: 1em; align: top; }
218233
--- AutoEpub3/cTools.vb (revision 359)
+++ AutoEpub3/cTools.vb (revision 360)
@@ -1196,7 +1196,7 @@
11961196 sScr = "../" & sScr
11971197 End If
11981198
1199- sGaiji = "<img class=""mobiImgChar_Bottom_5px"" alt="""" src=""" & sScr & """/>"
1199+ sGaiji = "<img class=""mobiImgChar_inline"" alt="""" src=""" & sScr & """/>"
12001200
12011201 End Function
12021202
Afficher sur ancien navigateur de dépôt.