How to read files off a network drive/folder? Please help!

  • Thread starter Thread starter Duy Vu
  • Start date Start date
D

Duy Vu

Hi all,
I'm using VB.Net 2003 to write a small program to display images in
PictureBox1:

Dim filePath As String
Dim fileName As String
.........
.... Do some stuff to get filePath and fileName
.........
PictureBox1.Image = Image.FromFile(filePath + fileName)

I have no problem if the image file is on the local drive (C:), but if the
file is on a network drive then I have the "file not found"error. I have
checked & confirmed that the network drive in question is mapped, and the
file is at the right location as suggested in filePath. Oh, BTW, I also used
admin right to the drive, so access permission is out of question.
Any Ideas?
Thanks in advance!
 
Just a thought...have you replaced your 'filePath+fileName' variables with
the hard-coded path? Does it return the same error or is it OK?

Will quickly try the same as you.

Rgds, Phil
 
Thanks for the suggest tion. However, I got it figured out. Instead of using
\\servername\sharedfolder\ as the file path, I was using Windows mapped
drive letter, i.e "S:\sharedfolder\" for the file path, and this gave me the
"file not found" error.
 
Back
Top