我如何在asp.net MVC 3.0网站上每年自动续订用户帐户 [英] How can i auto renew users account annually in asp.net MVC 3.0 website

查看:66
本文介绍了我如何在asp.net MVC 3.0网站上每年自动续订用户帐户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



在我的网站上,我想提供一个自动续订功能来续订用户的会员资格。我有自动更新用户的功能。我想要一些解决方案,在注册日期后1年内调用此功能。



我从数据库中取出注册日期。现在我想要一些机制在特定时间每天调用此函数来检查其订阅已过期的所有用户。如果有用户然后续订订阅。



请建议我以正确的方式执行此操作。



忘了告诉你我正在windows Azure平台上发布我的网站。





谢谢。

解决方案

有不同的方法可以实现这一目标。其中一些是



1)您可以编写SQL Server作业并安排它每天运行以检查订阅已过期的用户并自动续订。但是您需要在数据库中执行此操作的权限。请与您的DBA联系以获取权限。查看此链接以了解如何安排工作。

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







2)编写一个控制台应用程序,它将与数据库交互并执行类似的工作。您可以使用Windows中的任务计划程序安排您的exe。下面的链接说明了如何在Windows 7中创建计划的用户。

http://windows.microsoft.com/en-US/windows7/schedule-a-task


一些网络提供商确实提供了可用于呼叫的计时器一个网页。我是用ISQ解决方案做的。



或者,如果你的服务器经常使用而且准确的时间不是问题,你可以简单地检查你收到的时间如果需要,请求并在响应请求后进行处理。



如果它是您自己的服务器,那么您可以随心所欲地做任何事情......

Hi All,

In my website i want to give a Auto Renew feature to renew membership of users. I have function to auto renew the user. I want some solution for calling this function after 1 year from his registration date.

I am taking the registration date from the database. Now i want some mechanism to call this function each day at specific time to check all users whose subscription is expired. If there are users then renew there subscription.

Please suggest me to do this in proper way.

Forgot to inform you that i am publishing my website on windows Azure platform.


Thanks.

解决方案

There are different ways you can achieve this. Some of which are

1) You can write a SQL Server Job and schedule it to run daily to check users whose subscriptions has expired and auto-renew it. But you will require permissions to do this in your Database. Contact your DBA for the permissions. Check this link to learn on how to schedule a Job.
http://msdn.microsoft.com/en-us/library/ms191439.aspx

or

2) Write a console application which will interact with the Database and do the similar job. You can schedule your exe using the Task Scheduler in Windows. The Link below explains how to create a scheduled taks in Windows 7.
http://windows.microsoft.com/en-US/windows7/schedule-a-task


Some web providers do provide timer that can be used to "call" a web page. I do that with ISQ Solutions.

Alternatively, if your server is used a lot and the exact time is not an issue, you might simply check the time when you receive a request and do the processing after responding to the request if desired.

If it is your own server, then you can do whatever you want...


这篇关于我如何在asp.net MVC 3.0网站上每年自动续订用户帐户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆