Windows Schdule任务通过c#和asp net给出访问被拒绝错误

时间:2013-04-02 10:49:31

标签: c# asp.net c#-4.0 scheduling

我通过C#和asp.net创建了一个计划。它在发送的开发服务器中工作,但是它提供了以下问题的实时服务器

Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

public Task CreateTask(string name) 
{
    Task tester = OpenTask(name);
    if (tester != null) {
    tester.Close();
    throw new ArgumentException("The task \"" + name + "\" already exists.");
    }
    try {
        object o;
            //Error Occrured at this below line of Code
        its.NewWorkItem(name, ref CTaskGuid, ref ITaskGuid, out o); 
        ITask iTask = (ITask)o;
        return new Task(iTask, name);
        }
    catch (Exception objException)
    {                       
       throw objException;          
    }   
}

0 个答案:

没有答案