本文整理汇总了C#中Task.CleanPxeBoot方法的典型用法代码示例。如果您正苦于以下问题:C# Task.CleanPxeBoot方法的具体用法?C# Task.CleanPxeBoot怎么用?C# Task.CleanPxeBoot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Task
的用法示例。
在下文中一共展示了Task.CleanPxeBoot方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DeleteActiveMcTask
public void DeleteActiveMcTask(int mcTaskID, string groupName, string PID)
{
Task task = new Task();
List<string> hostMacs = new List<string>();
hostMacs = task.DeleteActiveMc(mcTaskID, groupName);
for (int i = 0; i < hostMacs.Count; i++)
{
string pxeHostMac = task.MacToPXE(hostMacs[i]);
task.CleanPxeBoot(pxeHostMac);
}
try
{
Process prs = Process.GetProcessById(Convert.ToInt32(PID));
string processName = prs.ProcessName;
if (Environment.OSVersion.ToString().Contains("Unix"))
{
while (!prs.HasExited)
{
task.KillProcessLinux(Convert.ToInt32(PID));
Thread.Sleep(1000);
}
}
else
{
if (processName == "cmd")
task.KillProcess(Convert.ToInt32(PID));
}
Utility.Message = "Successfully Deleted Task";
}
catch (Exception ex)
{
Logger.Log(ex.ToString());
Utility.Message = "Could Not Kill Process. Check The Exception Log For More Info";
}
}
示例2: DeleteActiveTask
public void DeleteActiveTask(int taskID)
{
Task task = new Task();
string hostMac = task.DeleteActive(taskID);
if (hostMac != "error")
{
string pxeHostMac = task.MacToPXE(hostMac);
if (task.CleanPxeBoot(pxeHostMac))
Utility.Message = "Successfully Deleted Task ";
}
else
Utility.Message = "Could Not Delete Active Task. Check Exception Log For More Info";
}
示例3: RollBack
public void RollBack(Multicast multicast, bool mcTaskCreated, bool activeTaskCreated, bool pxeBootCreated)
{
Task task = new Task();
if (pxeBootCreated)
{
string pxeHostMac;
for (int i = 0; i < multicast.HostNames.Count; i++)
{
pxeHostMac = task.MacToPXE(multicast.HostMacs[i]);
task.CleanPxeBoot(pxeHostMac);
}
}
if (activeTaskCreated)
multicast.RollBackActiveTasks(multicast);
if (mcTaskCreated)
multicast.RollBackActiveMCTask(multicast);
}