Exemple #1
0
 //
 static string procinfo()
 {
     System.Diagnostics.Process proc   = System.Diagnostics.Process.GetCurrentProcess();
     System.Text.StringBuilder  result = new System.Text.StringBuilder();
     result.AppendFormat("\n\nPrivate Bytes = {0} MB ", proc.PrivateMemorySize64 / (1024 * 1024));
     result.AppendFormat("\n\rProcess {0}", proc.ToString());
     result.AppendFormat("\n\rid = {0}\n\rMachine = {1}\n\rProcName = {2}", proc.Id, proc.MachineName, proc.ProcessName);
     return(result.ToString());
 }
Exemple #2
0
        static void Main(string[] args)
        {
            ExampleWithComparisons();

            try
            {
                var pEntity = new Person("James");
                pEntity.DoSomeWriting();
            }
            catch (Exception ex)
            {
                ex = ex;
            }

            onClassFinished();

            var          userInput          = Console.ReadLine();
            ProcessCheck userPickedFunction = null;

            if (userInput == "op1")
            {
                userPickedFunction = op1;
            }

            else if (userInput == "op2")
            {
                userPickedFunction = op2;
            }
            bool finalResult;

            if (userPickedFunction(out finalResult))
            {
            }


            var newObject     = new System.Diagnostics.Process();
            var anotherObject = new Program();

            string pString = newObject.ToString();
        }