Post[Help]Read .pdf file

Posts 1–3 of 3 · Page 1 of 1
[Help]Read .pdf file
How would you read a pdf file from your resource folder?
Posted in the snippet's vault by nextgen:

Read File Content


[PHP]

Public Shared Function ReadFileContent(ByVal sFile As String) As String

Dim GetFileC As String = String.Empty

If File.Exists(sFile) Then

Dim ActualC As StreamReader = File.OpenText(sFile)

Try
ActualC = File.OpenText(sFile)
GetFileC = ActualC.ReadToEnd()

Catch exp As Exception

Throw ex

Finally

If Not Nothing Is ActualC Then

ActualC.Close()

End If

End Try
End If
Return GetFileC

End Function [/PHP]

To Call it Use

ReadFileContent ("File Location")

Get File Extension


[PHP]

Public Shared Function GetExtension(ByVal strFileName As String) As String

If (strFileName.Length > 0) Then

stringDoc = strFileName.Split(characterA)

Return "." + stringDoc(stringDoc.Length - 1)

Else

Return ""

End If
End Function [/PHP]

To use Call the Function

GetExtension ("File Location and Name")
Got to love the vault

Knew the code looked familiar

But first you will have to use the extract resource method I gave you in another post.




Posts 1–3 of 3 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us