Click here to Skip to main content
15,891,567 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
See more:
Hi,

My problem is how do I disable an account after 15 days?

In my project I need it to work automatically, I want some code.

Please help with code and also give some idea about this...
Posted
Updated 8-Dec-10 21:59pm
v3
Comments
m@dhu 9-Dec-10 2:07am    
Any effort did you try anything?
Dalek Dave 9-Dec-10 3:59am    
Edited for Grammar, Syntax and Readability.

However if you cant install a windows service in that case you will have to do something dirty like check if the person who is logging in has been there for more than 15 days and in that case disable the account on the fly.
 
Share this answer
 
Write a Windows service to check & update values in database so you can disable the things. That's all.
For reference
Creating a Windows Service in C#
[^]
 
Share this answer
 
Comments
Dalek Dave 9-Dec-10 3:59am    
Good Call.
Manfred Rudolf Bihy 10-Dec-10 8:51am    
My vote of 3: Creating a service for the sole purpose of this is a bit of an overkill. I'd use Gauravs appoach or scheduling a job that runs an SQL statement against the database periodically.
thatraja 10-Dec-10 8:57am    
Dude I agree your comment but he was asked the solution in ASP.NET & also even he didn't mentioned SQL anywhere in tag or question. If Enquirer asked question completely with clear Title,Tag,content, etc., then we can answer or give solution completely. Anyway Cheers.
If your database is MS SQL try schedule Jobs in MS SQL Server:

http://msdn.microsoft.com/en-us/library/ms191439.aspx


Cheers


Manfred
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900