I have to store each profile name in an Observable collection, but I don't know how to do this, I made a big part of the project, but it is how to acces to EACH profile name that I don't know how to do.
I saw people are using Substrings and IndexOf, I tried but the problem is that I have more than only one profile name to display so this isn't working.
I followed this tutorial: https://www.youtube.com/watch?v=Yr3nfHiA8Kk But it is showing how to do but with the Wifi currently connected
InitializeComponent();
ObservableCollection<String> reseaux = new ObservableCollection<String>();
System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.FileName = "netsh.exe";
//p.StartInfo.Arguments = "wlan show interfaces";
p.StartInfo.Arguments = "wlan show profile";
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.Start();
/*foreach (System.Diagnostics.Process profile in profile)
{
reseaux.Add(reseauName);
}*/
lesReseaux.ItemsSource = reseaux;