Results 1 to 9 of 9

Thread: How to check a file in a folder

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2004
    Location
    India
    Posts
    91

    How to check a file in a folder

    Hi

    I want to search in a folder whether it contain a image or not(the image can of any type means .gif,.jpg) ,on that basis i want to do further processing ,pls any one can help me out.

    Thx in Advance

    Yogesh

  2. #2
    Junior Member
    Join Date
    Nov 2001
    Location
    UK WMids
    Posts
    24

    Re: How to check a file in a folder

    lol,
    try dir function

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jul 2004
    Location
    India
    Posts
    91

    Re: How to check a file in a folder

    Hi

    Iam new to vb how to use dir function and can i do same thing file ssytem object if yes how?

    Thx

    Yogesh

  4. #4
    Junior Member
    Join Date
    Nov 2001
    Location
    UK WMids
    Posts
    24

    Re: How to check a file in a folder

    VB Code:
    1. if dir("c:\test.jpg") <> "" then
    2.    'File exists
    3. Endif

  5. #5
    Junior Member
    Join Date
    Nov 2001
    Location
    UK WMids
    Posts
    24

    Re: How to check a file in a folder

    I think the best thing for you to do is read a book on programming or take a course.
    No offence, but Dir is a basic function which is essential to programming with vb.

    No offence and thanks.

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Jul 2004
    Location
    India
    Posts
    91

    Re: How to check a file in a folder

    Hi
    Perhaps u wont get my question properly i dont want to search for a specific image the folder can conatin any number of images with different extension,
    perhaps u got now.
    Yogesh

  7. #7
    Junior Member
    Join Date
    Nov 2001
    Location
    UK WMids
    Posts
    24

    Re: How to check a file in a folder

    Sorry, you need to go on a course.
    I could explain but cba.

    Thanks,
    Steve.

  8. #8
    Junior Member
    Join Date
    Nov 2001
    Location
    UK WMids
    Posts
    24

    Re: How to check a file in a folder

    Quote Originally Posted by vbyogesh
    Hi
    Perhaps u wont get my question properly i dont want to search for a specific image the folder can conatin any number of images with different extension,
    perhaps u got now.
    Yogesh
    Oh, I understand the question ok.
    But you really should try other sources before you ask us to write your code for you.

    Try here
    http://msdn.microsoft.com/library/de.../vafctdirx.asp

  9. #9
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: How to check a file in a folder

    I hope this helps....
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width