Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9256179
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T11:52:50+00:00 2026-06-18T11:52:50+00:00

EDIT: Ok, as of now and looking through countless posts I this i’ve arrived

  • 0

EDIT:

Ok, as of now and looking through countless posts I this i’ve arrived to a solution, I cannot do what I need to do from a service, I wanted it to be a service so that it would always be on for the computer, but apparently with the way services are written I may not be able to run the commands I want to run because “The service does not run in the same space as the users desktop” so it wont be able to capture the desktop, at least, thats what im gathering so far.

As for now, I’ll leave this here and maybe find a way to start a program under the users name when they logon, to capture the desktop, rather than try and do it from the service directly.

I’ve been banging my head on the wall for a couple hours now trying to figure this out, I’ve never made a service before, just forms applications, well my next project (Client Server Model Client Monitoring utility) needs to be installed as a service on the client machines and send data back to the main server.

Having never written a service before I looked up how to write one and how to install it and whatnot. I got it all working fine, the current working version spits an event log out every 30 seconds to show its working.

I started by running it in LocalSystem because I assumed it had the permissions to write to the file, but after that failed I tried LocalService, that didn’t work either.

Im specifying the Directory as C:\WatcherData\Test.jpg

and tested it in a regular forms application (which works)

OutputImage.Save(“c:\watcherdata\test.jpg”, ImageFormat.Jpeg);

No exceptions, no events, it just doesn’t happen, but the EventLog message is put in immediately before it,so it should be reaching that point, right?

Any assistance would be appreciated, If you need to know anything else I would be happy to oblige

EDIT:
Here goes a little code:

private void ServiceWorkerThread(object state)
    {
        while (!this.stopping)
        {
            this.eventLog1.WriteEntry("This is a test2");

            CallMe();

            Thread.Sleep(30000);
        }

        this.stoppedEvent.Set();
    }

    private void CallMe()
    {
        try
        {
            int screenWidth = Screen.GetBounds(new Point(0, 0)).Width;
            int screenHeight = Screen.GetBounds(new Point(0, 0)).Height;
            Bitmap OutputImage = new Bitmap(screenWidth, screenHeight);
            Graphics gfx = Graphics.FromImage((Image) OutputImage);
            gfx.CopyFromScreen(0, 0, 0, 0, new Size(screenWidth, screenHeight));
            OutputImage.Save("c:\\watcherdata\\test.jpg", ImageFormat.Jpeg);
        }
        catch (Exception e)
        {
            this.eventLog1.WriteEntry(e.Message + "\r\n" + e.StackTrace, EventLogEntryType.Error);
        }
    }

most of it was taken from a Microsoft sample document, as I said, I’m new to services

currently still trying to figure it out, will let you guys know if i get anywhere

EDIT 2

After playing around some more I managed to get it to write to the file, After realizing that most of the problem was with my lack of knowledge on how to build services and installers, apparently i wasnt rebuilding the installers when i built my service.

Now it just writes all black, a large, black picture. but at least its writing!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T11:52:51+00:00Added an answer on June 18, 2026 at 11:52 am

    How about some source code?

    I might add some tracing to make sure the file write code is executed.

    Most cases, this type of failure is a permissions issue and/or folks are trying to write to a Windows system directory. You question suggests you are ensuring that you are NOT writing to a Windows Directory. Please make sure c:\watcherdata folder exists.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Edit This question has gone through a few iterations by now, so feel free
THIRD EDIT: I now believe that this problem is due to a SOAP version
EDIT: There's now a doc page on this so this question is irrelevant, also
EDIT: This code now works correctly, I only left it in case someone finds
EDIT: This question is now redundant since Twitter no longer supports basic auth. I've
First off I have gone through this link http://codex.wordpress.org/Integrating_WordPress_with_Your_Website . I cannot use this.
Now, I did find the Google Finance API and started looking through that but
I have a pretty specific request. I have been looking through some other posts,
I'm learning C right now, and I copied this little snippet straight from the
I was looking through the jQuery code and found this line: elem.runtimeStyle.left = elem.currentStyle.left;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.