c# online scheduling application - c#

I would like to find some tool that would let me run scheduled c# job online, for example every night at 2 am.
I need to run some scripts every day, but I don't want to do it manually, also and I don't always have my computer around.
Does anyone know any tool like this?
BR

Try writing a .exe that create HTTP request. Use Windows Task Scheduler to schedule that .exe to run on a schedule.

Related

asp.net Website Serverside threads

I am creating a little Website which is basically a leaderboard from a specific game.
Im using C#6 - 4.6.
I am using a Webhosting by 1and1.
My question/problem:
The leaderboard has to update itself every 10 minutes. I am using an API to get the newest informations and then save it into a mysql db.
I cannot use cronjobs(using Windows hosting) and i cannot create scheduled tasks (Only webhosting and not a server...).
I was talking to support, but they could not help me because of lagg of knowledge in c# and win hosting.
So i tested something in my Visual studio: I created a seperate Thread which does the update, wait for X minutes and then does it again (infinit, until i stop it).
Works like a charm on my pc, but when i publish it to the server, the thread starts executing and actually writes that into the log, but after around 10 seconds there is no more respond from the thread.
Everything from that thread is running serverside.
Can someone explain this to me or has a better idea on how to solve it?
If you need any code snippets, please let me know!
Thanks in advance,
Markus

Control when someone tries to print

Is it possible know when someone is printing a file in Windows using c# with any visual studio library?
I have no idea if its possible and where to start...
What I wanna to do is: everytime someone tries to print a file in Windows, my c# program execute and update some information in a database.
You might take a look at PrintSpooler
Here are some examples of using it:
PrintMonitor – A C# print spooler monitor
Monitor jobs in a printer queue (.NET)
You might also run it as Windows Service, so it is always running on background and starts when system starts.

How to update date-time of system on application start-up from the internet?

My C# application is dependent on system date and time and i want to check the date-time of the system on application start-up from internet. But i don't know how to do it?
The way you describe it's not so simple.
If you absolutely have synchronize system's time take a look at this project. It involves calling windows system api and I'm pretty sure you'll need high privileges to run that code.
If you just need to get time from the internet for your application this question has the answer for you.
I tried lot of solution's but the one below worked for me .
Process.Start("time", DateTime.Now.ToString());
just use Process Class and CMD to change the Time ,and i think you will need Administrator Privilege for that .
You can use this class to get the time from an NTP Server .

Monitoring Framework needed

I'm building a big application with a lot of modules, i want to monitor them. Every module has its own different parameters that I'm interested in, ranging from performance, to logical statuses of components.
Eventually i need to concentrate all this information, and to be able to display it. Is there a framework i can use to achieve this? im using .net 3.5
You could try Munin. Once you install it - you simply write some plugins - small programs that will grab values from your application. And print them to command line in the form of values and labels. For example:
NoRDNS.value 10
Breakin.value 1
LogPassPAM.value 0
NoID.value 0
LogPass.value 100
InvUsr.value 23
LogKey.value 0
RootAttempt.value 0
Floats are OK too.
Munin will call the plugins periodically (every 10 minutes by default) and plot beautiful PNG graphs over time, track the min/max/average info, and organize everything in static HTML pages.
For you, probably the biggest problem with Munin would be setting it up on Windows. I never tried it on Windows - for me it works on Linux. Fortunately official website does have some options for Windows - in particular the munin-node-win32 program. You would need it.
Unfortunately, munin-node-win32 will only collect the data. To store (as RDD) and render the graphs (as PNG) you would need the Munin server. That can run locally or remotely. For running it locally, Cygwing may be and option but a sure way it to setups a virtual machine (see QUEMU or VirtualBox) running a simple setup of Ubuntu or Debian. In there, setting-up the Munin server is very easy - simply, run:
sudo aptitude install munin
and edit /etc/munin/munin.conf - placing the local IP address of the host where your application and munin-node are running. You don't even need to restart anything - Munin will be already configured in CRON so it will read the config file and do its job every 10 minutes as long as the VM is running. Just in case something goes wrong - the logs will be in the usual /var/log folder.
It looks pretty involved but it's easier than writing your own monitoring and graphing framework. I have a close relative who re-invented the wheel and wrote a monitoring/plotting system from scratch in .NET but I would trust Munin much more than his code.
At the end of the day you would point your web-browser to a private network IP address of the VM and get a nice performance report that looks like this.
Try wolfpack.codeplex.com - .net windows service based monitoring framework - fully extensible & ships with loads of plugins!
Provides passive monitoring (polling for data) and active - you app can pump data/kpis/stats into wolfpack. It also provides a geckoboard data api so you can get rich business dashboards in an instant.
PS: I wrote wolfpack!
You can use appfirst product. They have a way of discovering network flow and display what you described. This might solve your question.

How to stop a PDA sleeping

I have an application for PDAs with a long running process, and I'm getting the problem that the PDA is going to sleep before the process has completed.
I haven't got any control over the power settings on the PDA, does anyone know a good way for my application to stop the PDA from going to sleep?
Many thanks
Have a look at:
http://www.pinvoke.net/default.aspx/coredll.SystemIdleTimerReset
You need to make a function that calls SystemIdleTimerReset, SHIdleTimerReset and simulates a key touch. Then you need to call it on a regular basis from within your application.
For an example in C++, look here:
Disable sleep mode in Windows Mobile 6

Categories

Resources