開始時にSourcePathを要求するコンソール アプリケーションがあります。ソース パスを入力すると、DestinationPathが要求されます。
私の問題は、Windowsアプリケーションを介してこれらのパスを提供することです。つまり、特定の時間間隔後にこれらのパラメーターをコンソールアプリケーションに自動的に提供するウィンドウフォームアプリケーションを作成する必要があります
達成できるかどうか...もしそうなら、助けてください...非常に緊急です...
ああ..貼り付けることができない多くのコードを試しましたが、アプリケーションの起動に使用するものは...
ProcessStartInfo psi = new ProcessStartInfo();
psi.FileName = @"C:\Program Files\Wondershare\PPT2Flash SDK\ppt2flash.exe";
psi.UseShellExecute = false;
psi.RedirectStandardError = true;
psi.RedirectStandardInput = true;
psi.CreateNoWindow = false;
psi.Arguments = input + ";" + output;
Process p = Process.Start(psi);
と
Process process = new Process
{
StartInfo = new ProcessStartInfo
{
CreateNoWindow = true,
FileName = @"C:\Program Files\Wondershare\PPT2Flash SDK\ppt2flash.exe",
RedirectStandardError = true,
RedirectStandardOutput = true,
UseShellExecute = false,
}
};
if (process.Start())
{
Redirect(process.StandardError, text);
Redirect(process.StandardOutput, text);
MessageBox.Show(text);
}
private void Redirect(StreamReader input, string output)
{
new Thread(a =>{var buffer = new char[1];
while (input.Read(buffer, 0, 1) > 0)
{
output += new string(buffer);
};
}).Start();
}
しかし、何も機能していないようです