• R/O
  • SSH
  • HTTPS

autocodeforsql: 提交


Commit MetaInfo

修订版369 (tree)
时间2020-07-25 16:06:30
作者hilinwei

Log Message

更改概述

差异

--- AutoEpub3/AutoEpub7.vb (revision 368)
+++ AutoEpub3/AutoEpub7.vb (revision 369)
@@ -1331,49 +1331,51 @@
13311331
13321332 Private Sub Button11_Click(sender As Object, e As EventArgs) Handles Button11.Click
13331333
1334- Dim sHtml As String = cTools.sFileReader("C:\Users\DTC_PC07\Downloads\WW1.txt", cEpub6.encGB2321)
13351334
1336- sHtml = sHtml.Replace("*******", "")
1337- sHtml = sHtml.Replace("******", "")
13381335
1339- sHtml = sHtml.Replace(" ", " ")
1336+ 'Dim sHtml As String = cTools.sFileReader("C:\Users\DTC_PC07\Downloads\WW1.txt", cEpub6.encGB2321)
13401337
1338+ 'sHtml = sHtml.Replace("*******", "")
1339+ 'sHtml = sHtml.Replace("******", "")
13411340
1341+ 'sHtml = sHtml.Replace(" ", " ")
13421342
13431343
1344- Dim listChapter As List(Of String) = sHtml.Split({vbCrLf & vbCrLf}, StringSplitOptions.None).ToList
13451344
1346- listChapter.RemoveAt(0)
13471345
1348- Dim mEpub As New List(Of modelChapter)
1346+ 'Dim listChapter As List(Of String) = sHtml.Split({vbCrLf & vbCrLf}, StringSplitOptions.None).ToList
13491347
1348+ 'listChapter.RemoveAt(0)
13501349
1351- For Each sChpater As String In listChapter
1350+ 'Dim mEpub As New List(Of modelChapter)
13521351
1353- Dim listLine As List(Of String) = sChpater.Split({vbCrLf}, StringSplitOptions.None).ToList
13541352
1355- Dim uChpater As New modelChapter
1353+ 'For Each sChpater As String In listChapter
13561354
1357- Dim sKe As List(Of String) = listLine(1).Split(" ").ToList
1358- sKe.RemoveAt(1)
1355+ ' Dim listLine As List(Of String) = sChpater.Split({vbCrLf}, StringSplitOptions.None).ToList
13591356
1357+ ' Dim uChpater As New modelChapter
13601358
1361- uChpater.Title = String.Join(" ", sKe)
1359+ ' Dim sKe As List(Of String) = listLine(1).Split(" ").ToList
1360+ ' sKe.RemoveAt(1)
13621361
1363- listLine.RemoveRange(0, 2)
13641362
1365- uChpater.listText = listLine
1366- mEpub.Add(uChpater)
1363+ ' uChpater.Title = String.Join(" ", sKe)
13671364
1365+ ' listLine.RemoveRange(0, 2)
13681366
1369- Next
1367+ ' uChpater.listText = listLine
1368+ ' mEpub.Add(uChpater)
13701369
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)
13761370
1371+ 'Next
1372+
1373+ 'Dim cEpub As New cEpub6(emEpub6.emEncCode.GB2321, emEpub6.emLan.ZH, "乌衣巷", "闫灵", "WYX_202004")
1374+ 'cEpub.bConvertToMobi = True
1375+ 'cEpub.CreateEpub(mEpub)
1376+ 'MessageBox.Show("Finished")
1377+ 'System.Diagnostics.Process.Start(cEpub.sOutPutPathFolder)
1378+
13771379 End Sub
13781380
13791381 Private Sub Button12_Click(sender As Object, e As EventArgs) Handles Button12.Click
@@ -1384,7 +1386,7 @@
13841386
13851387
13861388
1387- Dim bookPath As String = "C:\Users\DTC_PC07\Downloads\JL\"
1389+ Dim bookPath As String = "C:\Users\DTC_PC07\Downloads\Epub\ND\"
13881390 Dim ncxFilePath As String = Path.Combine(bookPath, "toc.ncx")
13891391
13901392 Dim fs As System.IO.FileStream = New System.IO.FileStream(ncxFilePath, System.IO.FileMode.Open)
@@ -1393,7 +1395,7 @@
13931395
13941396 Dim mEpub As New List(Of modelVolume)
13951397
1396- For iCtr As Integer = 0 To 0
1398+ For iCtr As Integer = 1 To model.navMap.Count - 1
13971399 Dim unitOne As ncxNavPoint = model.navMap(iCtr)
13981400 Dim unitVolume As New modelVolume
13991401 unitVolume.Title = unitOne.navLabel.text
@@ -1406,27 +1408,41 @@
14061408
14071409 For Each eachNax As ncxNavPointNavPoint In unitOne.navPoint
14081410
1409- Dim sPath As String = (bookPath & eachNax.content.src).Split("#").ToList(0)
1411+ Dim sPath As String = Path.Combine(bookPath, eachNax.content.src).Split("#").ToList(0)
14101412
1413+ If sPath.IndexOf("_split_") > -1 Then
1414+ sPath = sPath.Replace("000", "001")
1415+
1416+ End If
1417+
14111418 Dim mChapter As New modelChapter
14121419 mChapter.Title = eachNax.navLabel.text
14131420 Dim sHtml As String = cTools.sFileReader(sPath, cEpub6.encUTF8)
14141421
1422+ Dim listImg As List(Of String) = cTools.listNav_SE(sHtml, "<img", "/>", True)
1423+
1424+ For Each uImg As String In listImg
1425+ Dim sImgUrl As String = cTools.listNav_SE(uImg, "src=""", """/>", False)(0)
1426+ If uImg.IndexOf("calibre22") > -1 Then
1427+ Dim sImgKey As String = cTools.sMapImg(sImgUrl, emEpub6.emUrlImgDep.Volume)
1428+ sHtml = sHtml.Replace(uImg, sImgKey)
1429+ Else
1430+ Dim sImgKey As String = cTools.sGaiji(sImgUrl, emEpub6.emUrlImgDep.Volume)
1431+ sHtml = sHtml.Replace(uImg, sImgKey)
1432+ End If
1433+ Next
1434+
1435+
1436+
1437+
1438+
14151439 Dim listChapterLine As List(Of String) = cTools.listText_P(sHtml)
14161440 mChapter.listText = listChapterLine
14171441
1418- If mChapter.Title.IndexOf("感言") > -1 Then
1419- Continue For
1420- End If
14211442
1422- If mChapter.Title.IndexOf("版权信息") > -1 Then
1423- unitVolume.Title = listChapterLine(0).Split("·")(1)
1443+ unitVolume.listChapter.Add(mChapter)
14241444
1425- Else
1426- unitVolume.listChapter.Add(mChapter)
1427- End If
14281445
1429-
14301446 Next
14311447
14321448 End If
@@ -1436,8 +1452,8 @@
14361452 Next
14371453
14381454
1439- Dim cEpub As New cEpub6(emEpub6.emEncCode.SHIFT_JIS, emEpub6.emLan.ZH, "剑来", "烽火戏诸侯", "JL_202005")
1440- cEpub.bConvertToMobi = True
1455+ Dim cEpub As New cEpub6(emEpub6.emEncCode.SHIFT_JIS, emEpub6.emLan.ZH, "那多", "那多悬疑小说集", "NDXYXSJ_202005")
1456+ cEpub.bConvertToMobi = False
14411457
14421458 cEpub.CreateEpub(mEpub)
14431459 MessageBox.Show("Finished")
Show on old repository browser