Hack Forums
[C#] Check if the file exist inside the URL / website files folder - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [C#] Check if the file exist inside the URL / website files folder (/showthread.php?tid=4952760)



Check if the file exist inside the URL / website files folder - SwaggySwampMan - Aug 17, 2015

What to do here?

I aint asking for the code.

I want to check if the files existed in the directory "Users" from an URL ?

Code
if (!File.Exists("localhost/Users/2.2.2.2.2.2)) // This will check if the directory file "2.2.2.2.2.2.2" existed inside the Users directory from the URL localhost then do something if does not exist.
                    {
                        Console.WriteLine("IP Address does not exist!");
                        goto Main;
                        
                    }



* - Sicarius - Aug 17, 2015

(Aug 17, 2015 03:46 AM)SwaggySwampMan Wrote:  What to do here?

I aint asking for the code.

I want to check if the files existed in the directory "Users" from an URL ?

Code
if (!File.Exists("localhost/Users/2.2.2.2.2.2)) // This will check if the directory file "2.2.2.2.2.2.2" existed inside the Users directory from the URL localhost then do something if does not exist.
            {
            Console.WriteLine("IP Address does not exist!");
            goto Main;

            }

You should look into WebRequests. Should be just what you need.