Forum Xamarin.Android

running processes

signfrasignfra ITMember
edited November 2016 in Xamarin.Android

Good evening, how can it be declared the function"Process" after installing the permissions package?

Process [] = myProcesses Process.GetProcesses ();
foreach (Process myProcess in myProcesses)
{
Console.WriteLine (myProcess.ProcessName);
}

Thank you

current code

namespace lllll.Droid
{
[Activity(Label = "lllll", MainLauncher = true, Icon = "@mipmap/icon")]
public class MainActivity : Activity
{
int count = 1;

    protected override void create(Bundle savedInstanceState)
    {
        base.OnCreate(savedInstanceState);

        // Set our view from the "main" layout resource
        SetContentView(Resource.Layout.Main);

        // Get our button from the layout resource,
        // and attach an event to it
        Button button = FindViewById<Button>(Resource.Id.myButton);

        button.Click += delegate
        {
            button.Text = string.Format("{0} clicks!", count++);
            Process[] myProcesses = Process.GetProcessesByName;
            foreach (Process myProcess in myProcesses)
            {
                Console.WriteLine(myProcess.ProcessName);
            }


        };
    }
}

}

Sign In or Register to comment.