private async void button1_Click(object sender, EventArgs e)
{
try
{
using (var process = Process.Start(psi))
{
bool hasOutput, hasErrors;
do
{
string output = await process.StandardOutput.ReadLineAsync();
string errors = await process.StandardError.ReadLineAsync();
hasOutput = !(output is null);
hasErrors = !(errors is null);
if (hasOutput) richTextBox2.AppendText(output);
if (hasErrors) richTextBox2.AppendText(errors);
}
while (hasOutput || hasErrors);
}
}
catch (Exception eU)
{
// Сообщение о ошибке
MessageBox.Show(eU.Message);
// Информаци о ошибке
MessageBox.Show(eU.ToString());
}
}
private async void button1_Click(object sender, EventArgs e)
{
try
{
bool hasOutput, hasErrors;
string output = await process.StandardOutput.ReadLineAsync();
string errors = await process.StandardError.ReadLineAsync();
hasOutput = !(output is null);
hasErrors = !(errors is null);
if (hasOutput) richTextBox2.AppendText(output);
if (hasErrors) richTextBox2.AppendText(errors);
}
catch (Exception eU)
{
// Сообщение о ошибке
MessageBox.Show(eU.Message);
// Информаци о ошибке
MessageBox.Show(eU.ToString());
}
}
Feature 'nullable reference types' is not available in C# 7.3. Please use language version 8.0 or greater.
Next step 0
Next step 1
Next step 2
Next step 3
Next step 4
Next step 5
Next step 6
Next step 7
Next step 8
Next step 9
Next step 10
'The stream is currently in use by a previous operation on the stream.'
private void button1_Click(object sender, EventArgs e)
{
output = process.StandardOutput.ReadLineAsync().Result;
errors = process.StandardError.ReadLineAsync().Result;
richTextBox2.AppendText(errors);
richTextBox2.AppendText(output);
}
'StandardOut has not been redirected or the process hasn't started yet.'
private void button1_Click(object sender, EventArgs e)
{
output = process.StandardOutput.ReadToEndAsync().ToString();
errors = process.StandardError.ReadToEndAsync().ToString();
richTextBox2.AppendText(errors);
richTextBox2.AppendText(output);
}
System.Threading.Tasks.Task`1[System.String]System.Threading.Tasks.Task`1[System.String]
singleton
1. Использовать сжатие
2. Отдельно в файле сохранить данные и скорее всего где то на стороне ...
3. В таком формате попробовать сделать все довольно быстрым и для себя при этом удобным более менее ...
Массивы не самый удобный формат когда делаешь сложную структуру вручную просто - json как таковой использовал только как проходный и сам его не "создавал", даже как то в голову такая идея не приходила ни разу
Вопрос о скорости именно относительно него - т.к. он тоже не выглядит таким уж приятным для ручного создания БД в несколько МБ текста