@@ -1331,49 +1331,51 @@ | ||
1331 | 1331 | |
1332 | 1332 | Private Sub Button11_Click(sender As Object, e As EventArgs) Handles Button11.Click |
1333 | 1333 | |
1334 | - Dim sHtml As String = cTools.sFileReader("C:\Users\DTC_PC07\Downloads\WW1.txt", cEpub6.encGB2321) | |
1335 | 1334 | |
1336 | - sHtml = sHtml.Replace("*******", "") | |
1337 | - sHtml = sHtml.Replace("******", "") | |
1338 | 1335 | |
1339 | - sHtml = sHtml.Replace(" ", " ") | |
1336 | + 'Dim sHtml As String = cTools.sFileReader("C:\Users\DTC_PC07\Downloads\WW1.txt", cEpub6.encGB2321) | |
1340 | 1337 | |
1338 | + 'sHtml = sHtml.Replace("*******", "") | |
1339 | + 'sHtml = sHtml.Replace("******", "") | |
1341 | 1340 | |
1341 | + 'sHtml = sHtml.Replace(" ", " ") | |
1342 | 1342 | |
1343 | 1343 | |
1344 | - Dim listChapter As List(Of String) = sHtml.Split({vbCrLf & vbCrLf}, StringSplitOptions.None).ToList | |
1345 | 1344 | |
1346 | - listChapter.RemoveAt(0) | |
1347 | 1345 | |
1348 | - Dim mEpub As New List(Of modelChapter) | |
1346 | + 'Dim listChapter As List(Of String) = sHtml.Split({vbCrLf & vbCrLf}, StringSplitOptions.None).ToList | |
1349 | 1347 | |
1348 | + 'listChapter.RemoveAt(0) | |
1350 | 1349 | |
1351 | - For Each sChpater As String In listChapter | |
1350 | + 'Dim mEpub As New List(Of modelChapter) | |
1352 | 1351 | |
1353 | - Dim listLine As List(Of String) = sChpater.Split({vbCrLf}, StringSplitOptions.None).ToList | |
1354 | 1352 | |
1355 | - Dim uChpater As New modelChapter | |
1353 | + 'For Each sChpater As String In listChapter | |
1356 | 1354 | |
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 | |
1359 | 1356 | |
1357 | + ' Dim uChpater As New modelChapter | |
1360 | 1358 | |
1361 | - uChpater.Title = String.Join(" ", sKe) | |
1359 | + ' Dim sKe As List(Of String) = listLine(1).Split(" ").ToList | |
1360 | + ' sKe.RemoveAt(1) | |
1362 | 1361 | |
1363 | - listLine.RemoveRange(0, 2) | |
1364 | 1362 | |
1365 | - uChpater.listText = listLine | |
1366 | - mEpub.Add(uChpater) | |
1363 | + ' uChpater.Title = String.Join(" ", sKe) | |
1367 | 1364 | |
1365 | + ' listLine.RemoveRange(0, 2) | |
1368 | 1366 | |
1369 | - Next | |
1367 | + ' uChpater.listText = listLine | |
1368 | + ' mEpub.Add(uChpater) | |
1370 | 1369 | |
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 | 1370 | |
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 | + | |
1377 | 1379 | End Sub |
1378 | 1380 | |
1379 | 1381 | Private Sub Button12_Click(sender As Object, e As EventArgs) Handles Button12.Click |
@@ -1384,7 +1386,7 @@ | ||
1384 | 1386 | |
1385 | 1387 | |
1386 | 1388 | |
1387 | - Dim bookPath As String = "C:\Users\DTC_PC07\Downloads\JL\" | |
1389 | + Dim bookPath As String = "C:\Users\DTC_PC07\Downloads\Epub\ND\" | |
1388 | 1390 | Dim ncxFilePath As String = Path.Combine(bookPath, "toc.ncx") |
1389 | 1391 | |
1390 | 1392 | Dim fs As System.IO.FileStream = New System.IO.FileStream(ncxFilePath, System.IO.FileMode.Open) |
@@ -1393,7 +1395,7 @@ | ||
1393 | 1395 | |
1394 | 1396 | Dim mEpub As New List(Of modelVolume) |
1395 | 1397 | |
1396 | - For iCtr As Integer = 0 To 0 | |
1398 | + For iCtr As Integer = 1 To model.navMap.Count - 1 | |
1397 | 1399 | Dim unitOne As ncxNavPoint = model.navMap(iCtr) |
1398 | 1400 | Dim unitVolume As New modelVolume |
1399 | 1401 | unitVolume.Title = unitOne.navLabel.text |
@@ -1406,27 +1408,41 @@ | ||
1406 | 1408 | |
1407 | 1409 | For Each eachNax As ncxNavPointNavPoint In unitOne.navPoint |
1408 | 1410 | |
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) | |
1410 | 1412 | |
1413 | + If sPath.IndexOf("_split_") > -1 Then | |
1414 | + sPath = sPath.Replace("000", "001") | |
1415 | + | |
1416 | + End If | |
1417 | + | |
1411 | 1418 | Dim mChapter As New modelChapter |
1412 | 1419 | mChapter.Title = eachNax.navLabel.text |
1413 | 1420 | Dim sHtml As String = cTools.sFileReader(sPath, cEpub6.encUTF8) |
1414 | 1421 | |
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 | + | |
1415 | 1439 | Dim listChapterLine As List(Of String) = cTools.listText_P(sHtml) |
1416 | 1440 | mChapter.listText = listChapterLine |
1417 | 1441 | |
1418 | - If mChapter.Title.IndexOf("感言") > -1 Then | |
1419 | - Continue For | |
1420 | - End If | |
1421 | 1442 | |
1422 | - If mChapter.Title.IndexOf("版权信息") > -1 Then | |
1423 | - unitVolume.Title = listChapterLine(0).Split("·")(1) | |
1443 | + unitVolume.listChapter.Add(mChapter) | |
1424 | 1444 | |
1425 | - Else | |
1426 | - unitVolume.listChapter.Add(mChapter) | |
1427 | - End If | |
1428 | 1445 | |
1429 | - | |
1430 | 1446 | Next |
1431 | 1447 | |
1432 | 1448 | End If |
@@ -1436,8 +1452,8 @@ | ||
1436 | 1452 | Next |
1437 | 1453 | |
1438 | 1454 | |
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 | |
1441 | 1457 | |
1442 | 1458 | cEpub.CreateEpub(mEpub) |
1443 | 1459 | MessageBox.Show("Finished") |