Click here to Skip to main content
15,890,609 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi Friends,

How To check image is Exists or not in server .

i have using code like this;

C++
string Path="http:\\sample\image\";
if (Directory.Exists(Path))
        {.....
        }
        else
        {.....
        } 

but only check local path ....its not checking for server..


Regards,
sathya
Posted
Updated 28-Jan-12 3:08am
v3
Comments
Mohibur Rashid 28-Jan-12 8:43am    
It is not suppose to do, learn about http protocol
Sergey Alexandrovich Kryukov 28-Jan-12 14:02pm    
Right.
--SA
Richard MacCutchan 28-Jan-12 9:09am    
Firstly your string is wrong since you have unescaped backslash characters in it.
Sergey Alexandrovich Kryukov 28-Jan-12 14:03pm    
OP should have used:
string Path=@"http:\\sample\image\";

But absolute hard-coded URL are not useful in practice, good only during development...
--SA
Sergey Alexandrovich Kryukov 28-Jan-12 14:05pm    
This is not C++. Tag it properly.
However, why? The answer is "no". All you can do is to try to load the resource by this URL and catch exception.
I think, case closed.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900