0
        Dim streamf As System.IO.Stream
        Dim stringf As String
        stringf = OpenFileDialog1.FileName.ToString()
        streamf = OpenFileDialog1.OpenFile()

I have a file ScreenShot.png attached on the application installation path which means if user run the .exe file from Desktop it will store ScreenShot.png on his desktop and so on.

Now i need to get the full path to that ScreenShot.png file to be sent in the FAX

    Dim srcBt As Byte()
    Dim encodedBase64 As String
    Dim filereader As New IO.FileStream(stringf, IO.FileMode.Open)

    ReDim srcBt(filereader.Length)
    filereader.Read(srcBt, 0, filereader.Length)
    filereader.Close()

    encodedBase64 = System.Convert.ToBase64String(srcBt)

So the problem part is how can i put that location of the file to the Stringf ? Because example i have force user to locate the file using OpenFileDialog and i have predefined file

Anel H.
  • 9
  • 3
  • This link will be useful for you http://stackoverflow.com/questions/9980262/openfiledialog-default-path – Sankar Oct 10 '15 at 10:29

1 Answers1

0

This should convert any (relative) path to an absolut path:

Dim stringf_info As New System.IO.FileInfo(stringf)
stringf = stringf_info.FullName
dummy
  • 4,256
  • 3
  • 25
  • 36