By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,567 Members | 1,554 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,567 IT Pros & Developers. It's quick & easy.

how can i display image from network folder?

P: 1
imgPhoto.ImageLocation = My.Settings.PhotoPath & txtVno.Text.Trim & ".jpeg"

I want to get flexible extension .jpeg or .jpg or .JPG or .JPEG.
And then Another question is
"How can i know Image is valid or not?"
Sep 17 '10 #1
Share this Question
Share on Google+
1 Reply

P: 296
It appears you are trying to force the extension to ".jpeg" - but that probably will not work for you as you need to load the Image Control with an actual and existing file. If you change the reference to the file name it will not match and will not load. Just don't worry about the extension - if the file is a JPG (or JPEG) - or any legitimately common image file - it will load into the control just fine. Also, you must come from the Eunuchs world because in Windows file names are NOT case sensitive so don't worry about that either (e.g. JPG is the same as jpg is the same as JpG ... etc).
If you need to check the validity of the JPEG the easiest way is to use a try block - which will give you an exception to handle (with a message) if the file is not proper.
And in terms of loading from a network folder .. it's the same as loading it from the local drive - provided you have access to the network folder. You can use a mapped drive or a UNC - but I suggest you use a UNC since mapped drives in Windows tend to wonder aimlessly in and out of existence using some whimsical heuristic developed in a Redmond dungeon.
Sep 21 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.