Your question, your audience. Choose who sees your identity—and your question—with question security.
EnterInfo.exe 37 img05.png
//37 is the Record ID and img05.png is the image that I am moving to another folder and entering the information in a database
//Call Console Application
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = @"C:\inetpub\wwwroot\SportsData\EnterInfo.exe";
startInfo.Arguments = FileID + fileName;
Process.Start(startInfo);
The arguments do have values because I am able to display them on the page
startInfo.Arguments = FileID + " " + fileName;
startInfo.FileName = @"C:\inetpub\wwwroot\SportsData\EnterInfo.exe";
startInfo.WorkingDirectory = System.IO.Path.GetDirectoryName(startInfo.FileName);
string FileID = "37";
string fileName = "img05.png;
//Call Console Application
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = @"C:\inetpub\wwwroot\SportsData\EnterInfo.exe";
startInfo.Arguments = FileID + " " + fileName;
startInfo.UseShellExecute = false;
startInfo.CreateNoWindow = true;
startInfo.RedirectStandardError = true;
startInfo.RedirectStandardOutput = true;
using (var process = Process.Start(startInfo))
{
string message;
using (var reader = process.StandardOutput)
{
message = reader.ReadToEnd();
label1.Text = message;
}
if (!string.IsNullOrEmpty(message))
{
label1.Text = message;
}
else
{
using (var reader = process.StandardError)
{
label1.Text = reader.ReadToEnd();
}
}
}
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Join the community of 500,000 technology professionals and ask your questions.