Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

start 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 :: excute bash and other linux scripts from c# 
Csharp :: c# inline a function 
Csharp :: invert string c# 
Csharp :: merge point of two list 
Csharp :: instantiate iqueryable c# 
Csharp :: enable fullscreen unity code 
Csharp :: c# list remove duplicate items 
Csharp :: how to make a enum list in c# 
Csharp :: how to reference a child object unity 
Csharp :: tinyint in c# 
Csharp :: decimal to string c# 
Csharp :: c# compile just one exe 
Csharp :: entity framework update child records 
Csharp :: unity target frame rate 
Csharp :: Unity c#loading a scene after a few seconds 
Csharp :: No context type was found in the assembly 
Csharp :: hashing a file in C# 
Csharp :: base64 decode how used in c# 
Csharp :: make folder with c# 
Csharp :: unity joystick movement 2d 
Csharp :: c# integer to bit string 
Csharp :: c# double to string with dot 
Csharp :: look rotation only on y axis in unity 
Csharp :: .net framework get configuration value from web.config 
Csharp :: simple player controller unity 
Csharp :: why v-slot not working in vue 3 
Csharp :: gameobject in unity c# 
Csharp :: c# is in array 
Csharp :: c# messagebox result 
Csharp :: see if two string arrays are equal c# 
ADD CONTENT
Topic
Content
Source link
Name
7+8 =