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

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!
 
P

Phil

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
 
D

Duy Vu

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top