TheBulgarianWolf

Extract FIle

Mar 19th, 2021
509
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. namespace ExtractFile
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             Console.WriteLine("Enter your directory: ");
  10.             string directory = Console.ReadLine();
  11.             string[] separated = directory.Split("\\");
  12.             string file = separated[separated.Length - 1];
  13.             string[] fileConc = file.Split(".");
  14.             Console.WriteLine("File name: " + fileConc[0]);
  15.             Console.WriteLine("File extension: " + fileConc[1]);
  16.  
  17.         }
  18.     }
  19. }
  20.  
RAW Paste Data