How to take users session screen shot using C# - windows-services

I want to capture all users screens which are connected to my Machine. So how can I do that?
I want to create a windows service which capture users screen.
Thanks
Laxmilal

You can do that using Windows Terminal Service (WTS) API. This is what you need to do:
1. Use Local system as your system service account. Other accounts will not work.
2. Call WTSOpenServer, then using WTSEnumerateSessions retrieve list of sessions
3. You will get list of WTS_SESSION_INFO structures. Each item there represents sessions. You are only interested in sessions where State is WTSActive.
4. In a loop call CreateProcessAsUser for each session you identified in previous step. Specify sessionId from the WTS_SESSION_INFO structure you have for the session. The name of the process to run would be your favorite screen capture utility. I did not use any of those, but quick search on internet turns up few options.

Related

How to prevent user changing system date/time (in Windows 7)?

Having googled, the general advice is to create a standard, non-administrator account.
I just tried that. I only had one account, my own, which is an administrator and then created a second (not the Guest account). I logged out of my own account and into the new one and tried to change the time. Windows 7 popped up a box asking if my main account would allow this (and prompting for its password).
I have been told "it shall not be possible to change system date/time". I intended to deliver a PC with only a standard account and my s/w, but can't (I think) prevent the user from creating an administrative account and changing date/time.
Can I prevent this programatially from Delphi, or do I just have to say that if the user wants to be destructive I can't prevent it?
Generally this kind of restrictions are set using the Windows Group Policy
From delphi you can use the Group Policy API or the RSoP WMI Classes.
In your application, you can actually detect user changing system time while your application is running.
You will receive WM_TIMECHANGE when system time change.
When startup, you can saved the gettickcount (As StartTickCount) and now (As StartTime). When checking, you can check if the different between tickcount and the different between time match (allow a small discrepancy) and know the different. However, if the user change system time away from your application, this trick do not work. Maybe you can have a service which is auto start checking for this.
If you need to change back to original time, here is some resources :
CHANGE the system TIME
btw, in OS level, a normal user cannot create an admin user.

Twitter api - trigger on new post?

I have never worked with the twitter api, so I have no idea if this is possible. What I want to do is to trigger a url everytime something new happens on a users timeline (?). Is this possible, and if so, how do I do it?
Yes, but it takes a bit of work. You need to use the twitter streaming API, specifically the follow option.
From twitter:
Example: Create a file called ‘following’ that contains, exactly and
excluding the quotation marks: “follow=12,13,15,16,20,87” then
execute:
curl -d #following https://stream.twitter.com/1/statuses/filter.json
-uAnyTwitterUser:Password.
Basically you pass a list of user ids you want to follow, open a long-lived connection, and twitter sends back to you anything that the user posts publicly. You can monitor this connection and do things when a user posts something.
You have another option, called a User Stream , which gets you way more information about when a user does anything, but it requires the user's approval, and a much more complex authentication process via oAuth. So I would only use that if you need it.
How you're going to be keeping a persistant connection open to twitter is something very much dependent on your programming language and software. In Python, I really like tweepy, but even for python there are several different libraries, or you can just use curl or pycurl and do it yourself like in the example above.

iPhone Data Best Practices - caching vs remote

I'm developing an iPhone app that uses a user account and a web API to get results (json) from a website. The results are a list of user's events.
Just looking for some advice or strategies - when to cache and when to make an api call... and if the iPhone SDK has anything built in to handle these scenarios.
When I get the results from the server, they populate an array in a controller. In the UI, you can go from a table listing view, to a view of an individual event result - so two controllers share a reference to the same event object.
What gets tricky is that a user can change the details of an event. In this case I make a copy of the local Event object for the user's changes, in case they make an error. If the api call successfully goes through and updates that event on the server, I take these local changes from the Event copy and set the original Event object to match with setters.
I have the original controller observing if any change is made to the local Event object so that it can reflect it in the UI.
Is this the right way of doing things? I don't want to make too many API calls to reload data from the server, But after a user makes an update should I be pulling down the list again with the API call?
...I want to be careful that my local objects don't become out of sync with the remote.
Any advice is appreciated.
I took a similar approach with an app I built. I simply made a duplicate version of the remote data model with Core Data, and I use etags on the backend to prevent sync issues (in my case, it's okay to create duplicate records).
It sounds like you're taking a good approach to this.
Some time back, I developed an iOS app where in, I had almost same requirement to store data on server as well as locally to avoid several network call and also user can see their information without any delay.
In that app, user can store photos, nodes, checkIns and social media post and with all this data, app can form a beautiful timeline. So what we did was, we had everything locally and whenever user phone come in some WIFI zone, we start uploading that data to server and sync both (local and remote) databases.
Note this method works well when only one user can access this data.

How can I create a windows service in Delphi?

I have been assigned an assignment to create such a service in delphi which will track the logged in user activity on the computer. For this i have to
I want my service to be run in the background and should store the name of every ACTIVE window in particular time events.
Learn how to create windows service in delphi
How should I get started?
Create a Windows service in Delphi:
http://www.devarticles.com/c/a/Delphi-Kylix/Creating-a-Windows-Service-in-Delphi/
You will want to do some research in the CBT hooks provided by the Microsoft SDK. They include the ability to be notified each time a window is created, among other things.
The Service code from Aldyn is able to track logged in users. Not sure if it is what you want, but it must surely be a good start. The vendor goes through fits of activity and sleep, so be sure it does what you want as-is.
Aldyn SvCOM

How to pass context around in a ASP.NET MVC web app

Ok, I'm a newbie to ASP.NET web apps... and web apps in general. I'm just doing a bit of a play app for an internal tool at work.
given this tutorial...
http://www.asp.net/learn/mvc-videos/video-395.aspx
The example basically has a global tasklist.
So if I wanted to do the same thing, but now I want to maintain tasks for projects. So I now select a project and I get the task list for that project. How do I keep the context of what project I have selected as I interact with the tasks? Do I encode it into the link somehow? or do you keep it in some kind of session data? or some other way?
As it sounds like you are having multiple projects with a number of tasks each, it would be best practise to let the project be set in the URL. This would require a route such as "/projects/{project}/tasks". It follows the RESTful URL principle (i.e. the URL describes the content).
Using session state will not work if a user possibly have different projects open in multiple browser windows. Let's say I am logging into your system and a selecting two projects opening in two tabs. First the session is set to the project of the first opened tab, but as soon the second tab has loaded, the session will be overwritten to this project. If I then do anything in the first tab, it will be recorded for the second project.
I use:
Session state for state that should last for multiple requests, e.g. when using wizards. I'd be careful not to put too much data here though as it can lead to scalability problems.
TempData for scenarios where you only want the state to be available for the next request (e.g. when you are redirecting to another action and you want that action to have access to the state, but you don't want it to hang around after that)
Hidden form fields [input type="hidden"] for state that pertains to the form data and that I want the the controller to know about, but I don't want that data displayed. Also can be used to push state to the client so as not to overburden server resources.
ok, From what I can tell, the best option seems to be to save it into the Session data
RESTful URLs, hidden fields, and session cookies are your friends.

Resources