Process question?

C

ca___t

Hi there :

I want to start a consoneApplication using process.start method at web
application server side.I have a question at this.Why the
consoneApplication's process is start but not run consoneApplication's
code.But if I run the WebForm1.cs's code at a WinApplication project.it can
start the consoneApplication's process and run the consoneApplication's
code.

How to solve this question?
Thanks a lot
jiangyh

This is my code.

WebForm1.cs
private void Page_Load(object sender, System.EventArgs e)
{
try
{

if(File.Exists(@"C:\Inetpub\wwwroot\RealEstateSys\ConsoleApplication1\bin\De
bug\ConsoleApplication1.exe"))
{
System.Diagnostics.ProcessStartInfo Info = new
System.Diagnostics.ProcessStartInfo();

Info.FileName = "ConsoleApplication1.exe";
Info.Arguments = "test";
Info.UseShellExecute = false;
Info.WorkingDirectory =
@"C:\Inetpub\wwwroot\RealEstateSys\ConsoleApplication1\bin\Debug";
Info.RedirectStandardInput = false;
Info.RedirectStandardOutput = false;

Process proc = Process.Start(Info);
proc.WaitForExit();
}
}
catch(Exception ex)
{
ex.Message.ToString();
}
}


ConsoleApplication1.Class2.cs
public class Class2
{
[STAThread]
static void Main(string[] args)
{
bool lngRtn=false;
Class1 ftpu = new Class1();

lngRtn =
ftpu.UploadFileToFtp("210.172.XXX.XX",21,"******","******","c:\\test.csv","t
est.csv");
}
}
 
B

Bob Grommes

The console app would run on your web server, since that is the machine you
make the request to. You wouldn't see it running on the client.

--Bob
 
C

ca___t

Thanks Bob

Yes,My console app only start a process on my web server,but it don't
run any code in console app,How to solve this.

Thanks a lot.


Bob Grommes said:
The console app would run on your web server, since that is the machine you
make the request to. You wouldn't see it running on the client.

--Bob

ca___t said:
Hi there :

I want to start a consoneApplication using process.start method at web
application server side.I have a question at this.Why the
consoneApplication's process is start but not run consoneApplication's
code.But if I run the WebForm1.cs's code at a WinApplication project.it
can
start the consoneApplication's process and run the consoneApplication's
code.

How to solve this question?
Thanks a lot
jiangyh

This is my code.

WebForm1.cs
private void Page_Load(object sender, System.EventArgs e)
{
try
{

if(File.Exists(@"C:\Inetpub\wwwroot\RealEstateSys\ConsoleApplication1\bin\De
bug\ConsoleApplication1.exe"))
{
System.Diagnostics.ProcessStartInfo Info = new
System.Diagnostics.ProcessStartInfo();

Info.FileName = "ConsoleApplication1.exe";
Info.Arguments = "test";
Info.UseShellExecute = false;
Info.WorkingDirectory =
@"C:\Inetpub\wwwroot\RealEstateSys\ConsoleApplication1\bin\Debug";
Info.RedirectStandardInput = false;
Info.RedirectStandardOutput = false;

Process proc = Process.Start(Info);
proc.WaitForExit();
}
}
catch(Exception ex)
{
ex.Message.ToString();
}
}


ConsoleApplication1.Class2.cs
public class Class2
{
[STAThread]
static void Main(string[] args)
{
bool lngRtn=false;
Class1 ftpu = new Class1();

lngRtn =
ftpu.UploadFileToFtp("210.172.XXX.XX",21,"******","******","c:\\test.csv","t
est.csv");
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top