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\ConsoleApplicat ion1\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");
}
} 2 1647
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" <ca****@msn.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl... 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\ConsoleApplicat ion1\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"); } }
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" <bo*@bobgrommes.com> wrote in message
news:ea**************@tk2msftngp13.phx.gbl... 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" <ca****@msn.com> wrote in message news:%2****************@TK2MSFTNGP09.phx.gbl... 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\ConsoleApplicat ion1\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"); } }
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Michael J. Moore |
last post by:
Is it the listener process, or some other Oracle process. Also, on a UNIX
system, when you do "ps -ef" to see your processes, the PPID points back to
a process named "init". Why does the PPID not...
|
by: mwazir |
last post by:
Hi all,
I have reposted this question from dotnet.general as I have been advised
that this is a more appropriate forum for this question. Apologies for the
repost.
I have a process thats...
|
by: Doug Wyatt |
last post by:
So I'll preface this with the fact that I'm a UNIX developer by training and
have just recently gotten in to C# development on Windows. I'm basically
running in to a problem whereby I suspect...
|
by: A |
last post by:
Hi all,
This is sort of a newbie question. I have a method that creates a process
which in turn installs MSDE. Basically, after I start the process I need to
wait until it is complete and then...
|
by: Nikolay Petrov |
last post by:
I have a class which starts a process and redirects it's output and input.
My class have a method which starts the process and another which stops it.
How can I check if the process have been...
|
by: Zen |
last post by:
Hi,
My production machine has 2G of memory, when aspnet_wp.exe goes up to about
~1.2G of memory usage, I start get out-of-memory exception. Other processes
don't use as much memory and I added...
|
by: tony.newsgrps |
last post by:
Hi there,
I'm trying to understand the impact of killing a process that owns a
system mutex (used to ensure there is only 1 instance of my program
running)
Here is my code pretty much:
try...
|
by: Susan |
last post by:
I have a process that takes a while to run so I have it running
asynchronously so that the user can continue working. My question is that I
want to killl the process if the user changes the search...
|
by: SeC |
last post by:
Hi.
Is there any way to detect if application is being killed by 'End
Process' via Task Manager ?
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
| |