1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
| protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
// Set our view from the "main" layout resource
SetContentView(Resource.Layout.Param);
//Bouton ok
Button ok = FindViewById<Button>(Resource.Id.ok);
//gestion du click
ok.Click += delegate
{
EcritureFichier("parametre.txt");
EditText editText = FindViewById<EditText>(Resource.Id.saisieIP);
var tbun = editText.Text; editText.TextChanged += delegate { };
Console.WriteLine(editText);
Toast.MakeText(this, "Paramètre pris en compte!!", ToastLength.Short).Show();
};
public void EcritureFichier(string fichier)
{
try
{
// string resourcePrefix = ("AFC.");
var StreamWriter = new StreamWriter("parametre.txt");
{
StreamWriter.Write("hello world");
StreamWriter.Close();
System.Diagnostics.Debug.Write("Write Over");
}
}
catch (Exception ex)
{
// Code exécuté en cas d'exception
Console.Write(ex.Message);
}
}
}
} |
Partager