gpt4 book ai didi

C# - 让 ManagementObjectSearcher 输出到文本框

转载 作者:可可西里 更新时间:2023-11-01 10:28:35 24 4
gpt4 key购买 nike

我有以下获取计划任务的代码,尽管我无法将它们输出到文本框中:

private void button22_Click(object sender, EventArgs e)
{
var query = new ManagementObjectSearcher("SELECT * FROM Win32_ScheduledJob");
var tasks = query.Get();
richTextBox6.Text = ManagementObjectSearcher.ToString();
}

最佳答案

试试这个

        var query = new ManagementObjectSearcher("SELECT * FROM Win32_ScheduledJob");
var tasks = query.Get();
foreach (ManagementObject task in tasks)
{
richTextBox6.Text += Environment.NewLine + task["Description"]
}

关于C# - 让 ManagementObjectSearcher 输出到文本框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6417516/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com