有没有一种方法可以将任务计划程序的历史记录信息放入批处理或PowerShell脚本中的数组或变量中。
例如,获取信息,例如任务名称,任务启动时(事件ID:100)和任务完成时(事件ID:102)的日期和时间。这样,我就可以使用该信息更新SQL数据库。(SQL表可能看起来像这样,一旦知道了信息,我就知道如何插入数据库中)
TaskName TaskStart TaskCompleted
task1 27/09/2017 09:00:00 27/09/2017 10:00:00
task2 27/09/2017 12:00:00 27/09/2017 16:00:00
task1 04/10/2017 09:00:00 04/09/2017 09:55:00
Run Code Online (Sandbox Code Playgroud)
基本上,即使可能,我也不知道如何检索该信息。谢谢
如果我有一个字符串数组中的日期,例如23/05/2011,17/03/2012,01/07/2010等,是否可以先对年份进行排序,然后对几天进行排序,而不是先排序日期?
我有这个代码
private void button1_Click(object sender, EventArgs e)
{
Stream myStream;
OpenFileDialog openFileDialog1 = new OpenFileDialog();
openFileDialog1.Filter = "Text Files (.txt)|*.txt|All Files (*.*)|*.*";
openFileDialog1.FilterIndex = 1;
openFileDialog1.Multiselect = true;
if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
if ((myStream = openFileDialog1.OpenFile()) != null)
{
string strfilename = openFileDialog1.FileName;
string filetext = File.ReadAllText(strfilename);
richTextBox3.Text = filetext; // reads all text into one text box
}
}
}
Run Code Online (Sandbox Code Playgroud)
我正在努力如何将文本文件的每一行放到不同的文本框或可能将它存储在一个数组中,有人可以帮忙吗!