how can i display image from network folder?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zin zin
    New Member
    • Sep 2010
    • 1

    #1

    how can i display image from network folder?

    imgPhoto.ImageL ocation = My.Settings.Pho toPath & txtVno.Text.Tri m & ".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?"
  • !NoItAll
    Contributor
    • May 2006
    • 297

    #2
    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.

    Comment

    Working...