Hi i John
 I Novic to Mono  
 
I Want to Call 'Top' Command of Linux/Unix as Process  in Asp.net
Application Using  C# as Language and to  extract some of the stream
text. like memory status ..... but as it is always running when we
call.  i am getting infinite  wait(  as we need to press ctrl+c to
kill it  @ command prompt).
  I am unable to  Redirect stream data to standard output
some of my code
 
ProcessStartInfo startinfo;
Process process = null;
string stdoutputline;
StreamReader stdoutreader;
StringBuilder sb = new StringBuilder();
try  
{
startinfo = new ProcessStartInfo();
startinfo.FileName="top";
startinfo.CreateNoWindow=true;
startinfo.UseShellExecute=false;
startinfo.RedirectStandardOutput=true;
process = Process.Start(startinfo);
stdoutreader =process.StandardOutput;
   while((stdoutputline=stdoutreader.ReadLine())!=null)
    {
    string stp = stdoutputline.ToString();
    sb.Append(stp);
   }  
}
catch
{
      throw;
}
finally
{
   if(process!=null)
     {
    process.Close();
 }
   startinfo = null;
   process= null;
}
 lblAllVariable.Text =sb.ToString();  
 
Any Solution/Web Site Address to Learn it .
 
Eagerly Waiting for the Reply
 
Thank You
John





------------------------ Yahoo! Groups Sponsor --------------------~--> 
1.2 million kids a year are victims of human trafficking. Stop slavery.
http://us.click.yahoo.com/.QUssC/izNLAA/TtwFAA/saFolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to