hallo
ich laße eine tabelle erstellen und kopiere diese aneinander.
das funktioniert auch ganz gut, bis irgendwann nur noch chaos rauskommt.
wenn ich mir der quellcode in firefox ansehe, wird der quellcode ganz normal angezeigt.
hier mein code:
hat jmd ne idee ?
ich laße eine tabelle erstellen und kopiere diese aneinander.
das funktioniert auch ganz gut, bis irgendwann nur noch chaos rauskommt.
wenn ich mir der quellcode in firefox ansehe, wird der quellcode ganz normal angezeigt.
hier mein code:
VB.NET-Quellcode
- Public Sub CreateHtmlPlaylist(ByVal saveFile As String,
- ByVal fileList() As String,
- ByVal sourcePath As String,
- ByVal tmpFile As String)
- Dim tag As TagLib.Tag
- Dim mp3 As TagLib.File
- Dim htmlDir As String, dir As String, file As String
- Dim artistLink As String, albumLink As String, youTubeLink As String
- Dim allPlayTime As Double, playTime As Double
- Dim allBytes As Double, fileBytes As Double
- Dim p As UInteger
- On Error GoTo Quit
- If mainform.chkPlayListOnlyOnePlaylist.Checked = True Then
- saveFile = IO.Path.GetTempFileName
- End If
- Dim enc As Text.Encoding = Text.Encoding.UTF8
- Dim fPL As IO.StreamWriter = New IO.StreamWriter(saveFile, False, enc)
- dir = sourcePath
- htmlDir = Replace(dir, "\", "/")
- fPL.WriteLine("<!DOCTYPE HTML>")
- fPL.WriteLine("<head>")
- fPL.WriteLine("<meta charset = ""utf-8"">")
- fPL.WriteLine("<title>File Overview</title>")
- fPL.WriteLine("<style type = ""text/css"" > <!--")
- fPL.WriteLine(".s0 {")
- fPL.WriteLine("Font - family: tahoma;")
- fPL.WriteLine("Font-Size: 12px;")
- fPL.WriteLine("color: #000000; font-style: normal;")
- fPL.WriteLine("background-Color: transparent;")
- fPL.WriteLine("Text-align: Left();")
- fPL.WriteLine("}")
- fPL.WriteLine(".s1 {")
- fPL.WriteLine("Font - family: tahoma;")
- fPL.WriteLine("Font-Size: 12px;")
- fPL.WriteLine("color: #FFFFFF; font-style: normal;")
- fPL.WriteLine("background-Color: transparent;")
- fPL.WriteLine("Text-align: Left();")
- fPL.WriteLine("}")
- fPL.WriteLine("--></style>")
- fPL.WriteLine("</head><body leftmargin=50 bgcolor=""black"" link=""red"" alink=""red"" vlink=""red"">")
- fPL.WriteLine("<hr><font face=""tahoma"" size=4><Center><a href=""file://" & htmlDir & """>" & GetLastFolder(dir, False) & "</a></Center></font><hr>")
- fPL.WriteLine("<font color=""yellow"">")
- fPL.WriteLine("<table style = ""width:100%"">")
- fPL.WriteLine("<tr><td style=""font-weight: bold"">Dateiname</td><td style=""font-weight: bold"">Größe</td><td style=""font-weight: bold"">Länge</td><td style=""font-weight:bold"">Track</td><td style=""font-weight:bold"">Title</td><td style=""font-weight:bold"">Artist</td><td style=""font-weight:bold"">Album</td><td style=""font-weight:bold"">Genre</td></tr>")
- Dim sourceFile As String
- For p = 0 To fileList.Length - 1
- file = fileList(p)
- If mainform.chkPlayListFileOptionFullFilePath.Checked = False Then
- sourceFile = clsClass.GetPath(dir) & file
- Else
- sourceFile = file
- End If
- If mainform.rbPlayListReadID3v1.Checked = True Then
- ID3v1GetTag(sourceFile, mp3, tag)
- End If
- If mainform.rbPlayListReadID3v2.Checked = True Then
- ID3v2GetTag(sourceFile, mp3, tag)
- End If
- playTime = mp3.Properties.Duration.Minutes & "," & mp3.Properties.Duration.Seconds
- allPlayTime = allPlayTime + playTime
- fileBytes = FileLen(sourceFile)
- allBytes = allBytes + fileBytes
- artistLink = Link_GetArtistLink(tag.FirstArtist)
- albumLink = tag.FirstArtist & " - " & tag.Album
- albumLink = Net.WebUtility.UrlEncode(albumLink)
- albumLink = "https://www.last.fm/search/albums?q=" & albumLink
- youTubeLink = Link_GetYouTubeLink(tag.FirstArtist, tag.Title)
- fPL.WriteLine("<td class=""s0""><a href = ""file://" & sourceFile.Replace("\", "/") & """ target=""_blank"">" & IO.Path.GetFileNameWithoutExtension(sourceFile) & "</a></td>")
- fPL.WriteLine("<td class=""s1"">" & FormatBytes(fileBytes) & "</td>")
- fPL.WriteLine("<td class=""s1"">" & playTime.ToString & "</td>")
- fPL.WriteLine("<td class=""s1"">" & tag.Track.ToString & "</td>")
- fPL.WriteLine("<td class=""s0"">" & "<a href = """ & youTubeLink & """ target=""_blank"">" & tag.Title & "</td>")
- fPL.WriteLine("<td class=""s0""><a href = """ & artistLink & """ target=""_blank"">" & tag.FirstArtist & "</td>")
- fPL.WriteLine("<td class=""s0""><a href = """ & albumLink & """ target=""_blank"">" & tag.Album & "</td>")
- fPL.WriteLine("<td class=""s1"">" & tag.FirstGenre & "</td></tr>")
- Next p
- Quit:
- allPlayTime = Math.Round(allPlayTime / 60, 2)
- fPL.WriteLine("</table><hr><hr>")
- fPL.WriteLine("<p>" & fileList.Length.ToString & " Dateien " &
- "(" & FormatBytes(allBytes) & ") " &
- "(" & allPlayTime.ToString & "h Spielzeit)</p>")
- fPL.WriteLine("</body>")
- fPL.WriteLine("</html>")
- fPL.Close()
- If tmpFile IsNot Nothing Then
- Dim r As String = Text_ReadFile(saveFile)
- clsClass.Text_WriteTotFile(tmpFile, r)
- End If
- If mainform.chkPlayListOnlyOnePlaylist.Checked = True Then
- KillFile(saveFile, False)
- End If
- End Sub
hat jmd ne idee ?