C# 使用C语言的任务计划程序中的常规设置#

C# 使用C语言的任务计划程序中的常规设置#,c#,taskscheduler,C#,Taskscheduler,我想将任务计划程序中的“配置为”设置设置为“Windows 7” 当前C#代码: 任何帮助都将不胜感激 td.Settings.Compatibility应映射到该字段 有关每个版本在下拉列表中映射到的内容,请参见枚举中的xmldoc /// <summary>Defines what versions of Task Scheduler or the AT command that the task is compatible with.</summary> publi

我想将任务计划程序中的“配置为”设置设置为“Windows 7”

当前C#代码:

任何帮助都将不胜感激


td.Settings.Compatibility
应映射到该字段

有关每个版本在下拉列表中映射到的内容,请参见枚举中的xmldoc

/// <summary>Defines what versions of Task Scheduler or the AT command that the task is compatible with.</summary>
public enum TaskCompatibility
{
    /// <summary>The task is compatible with the AT command.</summary>
    AT,
    /// <summary>The task is compatible with Task Scheduler 1.0 (Windows Server™ 2003, Windows® XP, or Windows® 2000).</summary>
    V1,
    /// <summary>The task is compatible with Task Scheduler 2.0 (Windows Vista™, Windows Server™ 2008).</summary>
    V2,
    /// <summary>The task is compatible with Task Scheduler 2.1 (Windows® 7, Windows Server™ 2008 R2).</summary>
    V2_1,
    /// <summary>The task is compatible with Task Scheduler 2.2 (Windows® 8.x, Windows Server™ 2012).</summary>
    V2_2,
    /// <summary>The task is compatible with Task Scheduler 2.3 (Windows® 10, Windows Server™ 2016).</summary>
    V2_3,
}
///定义任务与哪些版本的任务计划程序或AT命令兼容。
公共枚举任务兼容性
{
///该任务与AT命令兼容。
在
///该任务与任务计划程序1.0(Windows Server)兼容™ 2003、Windows®XP或Windows®2000)。
V1,
///该任务与任务计划程序2.0(Windows Vista)兼容™, Windows服务器™ 2008).
V2,
///该任务与任务计划程序2.1(Windows®7,Windows Server)兼容™ 2008年(R2)。
V2_1,
///该任务与任务计划程序2.2(Windows®8.x,Windows Server)兼容™ 2012).
V2_2,
///该任务与任务计划程序2.3(Windows®10,Windows Server)兼容™ 2016).
V2_3,
}

我使用td.Settings.Compatibility.Equals(“Windows 8.1”)将配置设置为“Windows 8.1”。但它仍然没有任何作用。想知道我是否遗漏了什么。属性是一个枚举,正确的方法应该是
td.Settings.Compatibility==TaskCompatibility.V2_2
,看看我上面发布的代码,
V2_2
映射到“Windows®8.x,Windows Server”™ 在错过预定启动后尽快设置运行任务??
/// <summary>Defines what versions of Task Scheduler or the AT command that the task is compatible with.</summary>
public enum TaskCompatibility
{
    /// <summary>The task is compatible with the AT command.</summary>
    AT,
    /// <summary>The task is compatible with Task Scheduler 1.0 (Windows Server™ 2003, Windows® XP, or Windows® 2000).</summary>
    V1,
    /// <summary>The task is compatible with Task Scheduler 2.0 (Windows Vista™, Windows Server™ 2008).</summary>
    V2,
    /// <summary>The task is compatible with Task Scheduler 2.1 (Windows® 7, Windows Server™ 2008 R2).</summary>
    V2_1,
    /// <summary>The task is compatible with Task Scheduler 2.2 (Windows® 8.x, Windows Server™ 2012).</summary>
    V2_2,
    /// <summary>The task is compatible with Task Scheduler 2.3 (Windows® 10, Windows Server™ 2016).</summary>
    V2_3,
}