Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

ubuntu: how to open the terminal from c#

using System;
using System.Diagnostics;

namespace runGnomeTerminal
{
    class MainClass
    {
        public static void ExecuteCommand(string command)
        {
            Process proc = new System.Diagnostics.Process ();
            proc.StartInfo.FileName = "/bin/bash";
            proc.StartInfo.Arguments = "-c " " + command + " "";
            proc.StartInfo.UseShellExecute = false; 
            proc.StartInfo.RedirectStandardOutput = true;
            proc.Start ();

            while (!proc.StandardOutput.EndOfStream) {
                Console.WriteLine (proc.StandardOutput.ReadLine ());
            }
        }

        public static void Main (string[] args)
        {
            ExecuteCommand("gnome-terminal -x bash -ic 'cd $HOME; ls; bash'");
        }


    }
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: c# display float with 2 decimal places 
Csharp :: audio source pause unity 
Csharp :: insert new item listview c# 
Csharp :: merge point 
Csharp :: get date value from datepicker c# 
Csharp :: c# combobox selectedvalue 
Csharp :: c# console background color 
Csharp :: c# append textbox 
Csharp :: how to use file watcher in c# 
Csharp :: c# LCP 
Csharp :: loop over enum values 
Csharp :: color picker wpf 
Csharp :: c# check if string is path or file 
Csharp :: custom array initializer in c# 
Csharp :: how to name GameObject in c# 
Csharp :: how to get the date of the first day and last day of the week c# 
Csharp :: unity default cube mesh 
Csharp :: c# base64 encode 
Csharp :: c# create folder 
Csharp :: unity 2d movement 
Csharp :: c# add picturebox to form 
Csharp :: how get query from url in laravel 
Csharp :: unity RemoveComponent 
Csharp :: unity time deltatime 
Csharp :: where did mark twain go to school 
Csharp :: linq from select 
Csharp :: bitmap to imagesource c# 
Csharp :: .net mvc decimal displayformat currency 
Csharp :: make http request c# 
Csharp :: 2d rotation unity 
ADD CONTENT
Topic
Content
Source link
Name
7+9 =