יום שלישי, 12 באפריל 2011

hebrew docoding of file


hebrew docoding of file

  <meta http-equiv="Content-Type" content="text/html; charset=Windows-1255" />

Imports System.IO
Imports system.Data
Partial Class FollowUpTfasim
    Inherits System.Web.UI.Page

    Protected Sub FollowUpTfasim_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim filetoread As String
        filetoread = Server.MapPath("tofes.txt")
        Dim filestream As StreamReader
        filestream = File.OpenText(filetoread)
        Dim readcontents As String
        readcontents = filestream.ReadToEnd()
        Dim textdelimiter As String
        textdelimiter = "|"
        Dim splitout = Split(readcontents, textdelimiter)
        Dim i As Integer
        For i = 0 To UBound(splitout)
            lblsplittext.Text &= "<b>Link </b>" & i + 1 & ")   " & "<a href=" & splitout(i) & ">" & _
            ">" & splitout(i) & "</a>" & "<br>"
        Next
        Dim dt As New DataTable
        dt.Columns.Add("LinkText")
        dt.Columns.Add("LinkUrl")

        For Each str As String In splitout
            Dim SplitString = str.Split("~"c)
            dt.Rows.Add(SplitString(0), SplitString(1))
        Next

        pdfLinks.DataSource = dt
        pdfLinks.DataBind()

        filestream.Close()

    End Sub
End Class