Что-то вроде этого должно работать (хотя, Вы будете хотеть изменить интервал).
public Form1()
{
InitializeComponent();
Timer Every4Minutes = new Timer();
Every4Minutes.Interval = 10;
Every4Minutes.Tick += new EventHandler(MoveNow);
Every4Minutes.Start();
}
void MoveNow(object sender, EventArgs e)
{
Cursor.Position = new Point(Cursor.Position.X - 1, Cursor.Position.Y - 1);
}
Попробуйте добавить страницу default.aspx, которая поставляется с шаблоном проекта asp.net mvc 1.0. У меня была аналогичная проблема с запуском mvc 2 из коробки на компьютере с IIS 5 (XP), и это помогло.
Default.aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="YourNamespace.Website.Default" %>
<%-- Please do not delete this file. It is used to ensure that ASP.NET MVC is activated by IIS when a user makes a "/" request to the server. --%>
Default.aspx.cs:
using System.Web;
using System.Web.Mvc;
using System.Web.UI;
namespace YourNamespace.Website
{
public partial class Default : Page
{
public void Page_Load(object sender, System.EventArgs e)
{
// Change the current path so that the Routing handler can correctly interpret
// the request, then restore the original path so that the OutputCache module
// can correctly process the response (if caching is enabled).
string originalPath = Request.Path;
HttpContext.Current.RewritePath(Request.ApplicationPath, false);
IHttpHandler httpHandler = new MvcHttpHandler();
httpHandler.ProcessRequest(HttpContext.Current);
HttpContext.Current.RewritePath(originalPath, false);
}
}
}
Я предполагаю, что вам нужно повторно зарегистрировать или включить фреймворк в IIS. Попробуйте запустить aspnet_regiis из соответствующего дерева фреймворка и / или убедитесь, что соответствующая версия фреймворка разрешена в веб-расширениях IIS.