Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.IO;
- namespace ConsoleApplication1
- {
- class Program
- {
- static string searchQ;
- static int typeloc;
- static string extension;
- static string filename;
- static void Main(string[] args)
- {
- searchQ = Console.ReadLine();
- keywordS(searchQ);
- Console.Write(searchQ);
- Console.ReadLine();
- }
- static void keywordS(string kw)
- {
- if (kw.Contains("."))
- {
- typeloc = kw.LastIndexOf(".");
- extension = kw.Substring(typeloc, 4);
- filename = kw.Substring(0, typeloc);
- //Console.WriteLine("{0}\n{1}", filename, extension);
- Console.Write("Would you like to search for 1) Just the file name 2) Just that extension 3) Both? ");
- response(Convert.ToInt32(Console.ReadLine()));
- }else{
- Console.Clear();
- Console.Write("Please include an extension, e.g. test.png");
- Console.Clear();
- keywordS(searchQ);
- }
- }
- static void response(int r)
- {
- if (r == 1)
- {
- searching(filename);
- }
- else if (r == 2)
- {
- searching(extension);
- }
- else if (r == 3)
- {
- searching(searchQ);
- }
- else
- {
- Console.Clear();
- keywordS(searchQ);
- }
- }
- static void searching(string s)
- {
- }
- }
- }
Add Comment
Please, Sign In to add comment