i want code in c#.net to find directories and files in server location

Recommended Answers

I want a million pounds, doesn't mean I'll get it ;)

Jump to Post

All 2 Replies

I want a million pounds, doesn't mean I'll get it ;)

using System;
using System.IO;

namespace DW_402919
{
   class Program
   {
      static void Main(string[] args)
      {
         string[] arr_strFiles = Directory.GetFiles("*pathToFilesOnServer.*");
         foreach (string s in arr_strFiles)
         {
            Console.WriteLine(s);
         }
      }
   }
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.