facebook like

Friday, September 3, 2010

how can i write a program or application in c / c++ to set timer for my computer to shut down

sometimes you want to set timer for your pc after which it automatically shutdown,,,suposse
when you are copying files and you know it will be completed in 2 hours and you want to sleep
...here is where you can set your timer for 2.30 hours after which it will automatically shutdown
your pc....

here is link of source code and compiled exe file....
http://www.ziddu.com/download/11516935/timer.rar.html

the program is written in c/c++....

and here is the source code......in c++.....

#include<iostream.h>
#include<conio.h>
#include<stdio.h>
#include<dos.h>
#include<process.h>
#include<stdlib.h>
void main()
{
signed int hours,minutes,seconds;
textcolor(GREEN);
clrscr();


cout<<"\t\t|                                        TIMER                                                       |\n";

cout<<"\n \n \n \n\n\n\tPLEASE ENTER THE TIME IN";
textcolor(WHITE);
cout<<" HOURS::MINUTE::SECOND ";
textcolor(GREEN);
cout<<"FORMAT TO SET THE TIMER ";
cout<<"\n\n\n\n\tPLEASE ENTER  HOURS ::";
cin>>hours;
cout<<"\n\tPLEASE ENTER MINUTES ::";
cin>>minutes;
if(minutes >60)
{
do
{
cout<<"\n\tPLEASE ENTER MINUTES LESS THAN 60 ::";
cin>>minutes;
}while(minutes >60);
}
cout<<"\n\tPLEASE ENTER SECONDS ::";
cin>>seconds;

if(seconds >60)
{
do
{
cout<<"\n\tPLEASE ENTER SECONDSS LESS THAN 60 ::";
cin>>seconds;
}while(seconds >60);
}


if(!(hours==0 && minutes==0 && seconds ==0))
{
clrscr();
cout<<"\t\t|                                        TIMER                                                       |\n";

cout<<"\n\n\n\n\n\t\tYOUR SYSTEM WILL SHUTDOWN AFTER";

do{
if(hours==0 && minutes==0 && seconds ==0)
break;


if(minutes!=0 || hours!=0)
{
if(seconds==0)
{
seconds=60;

if(minutes == 0 && hours!=0)
{
minutes=60;
hours--;
}

minutes--;
}
}

seconds--;
delay(1000);
gotoxy(30,15);
if(hours<10)
cout<<"0"<<hours;
else
cout<<hours;
if(minutes<10)
cout<<"::0"<<minutes;
else
cout<<"::"<<minutes;
if(seconds<10)
cout<<"::0"<<seconds;
else
cout<<"::"<<seconds;



}while(seconds > -1);

 system("shutdown -s -f");

}
else
{
cout<<"\nPLEASE ENTER A VALID INPUT";
}
clrscr();
}

thanks
amit kumar singh@bpit

Friday, January 15, 2010

HOW TO RUN TURBO C/C++ OR 16-BIT C/C++ IN WINDOWS VISTA, SEVEN AND XP.

To run c/c++ 16 bit in windows vista,xp,windows 7 with full screen and 16-bit graphics support..
first download microsoft virtual pc(32-bit if your window vista is 32-bit edition else 64-bit version) from the following link..
DOWNLOAD
first intall the software cos another utility will not work without it.. and now download that another utility from the following link..
DOWNLOAD
run the software..
if will extract a folder...
open it,,,
click on dosv2.0..
thats,,it..it will open you a c/c++ compiler..
divesh pal @akgec
amit kumar singh@bpit

please leave your response..and suggestion
as it can help others.

Tuesday, July 7, 2009

UNABLE TO CONNECT TO ASP.NET DEVELOPMENT SERVER

hi..to solve the problem of unable to connect to asp.net development server problem u can read this out.

sometimes during debugging of our website code..we get a message
unable to connect to asp.net sever
here is a trick to resolve it
first download the file from following link
http://www.ziddu.com/download/13699026/WebDev.WebServer.rar.htmlextract the file ..
u will get an exe named WebDev.WebServer.exe
simply right click and copy it..
now..
goto your drive containing windows...
by deault this is c drive..
so open
the following path...
C:\Program Files\Common Files\microsoft shared\DevServer\9.0
you will find already a file named WebDev.WebServer.exe..
so what you have to do is simply replace this file...
by right click and paste...
and click yes on the message that you want to replace the file..
yes its done ...

amit kumar singh@bpit