Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace App1
- {
- [Activity(Label = "App1", MainLauncher = true)]
- public class MainActivity : Activity
- {
- protected override void OnCreate(Bundle savedInstanceState)
- {
- base.OnCreate(savedInstanceState);
- // Set our view from the "main" layout resource
- SetContentView(Resource.Layout.Main);
- // Get the latitude/longitude EditBox and button resources:
- String UserName = FindViewById<EditText>(Resource.Id.UserName).Text;
- String UserEmail = FindViewById<EditText>(Resource.Id.UserEmail).Text;
- String UserPassword = FindViewById<EditText>(Resource.Id.UserPassword).Text;
- Button LoginButton = FindViewById<Button>(Resource.Id.LoginButton);
- // When the user clicks the button ...
- LoginButton.Click += async (sender, e) =>
- {
- //On button click it will run a url to see if the user can log in, if not will be prompted to register
- LoginUser(UserName, UserEmail, UserPassword);
- };
- }
- //Create new methods here
- //Create a Client here for HTTP services and share in app
- private static readonly HttpClient client = new HttpClient();
- // Gets weather data from the passed URL.
- private void LoginUser(String UserName, String UserEmail, String UserPassword)
- {
- {
- Uri uri = new Uri("http://192.168.0.104:5000/create_user/ " + UserName + "/" + UserEmail + "/" + UserPassword );
- WebRequest webRequest = WebRequest.Create(uri);
- WebResponse response = webRequest.GetResponse();
- Console.WriteLine(((HttpWebResponse)response).StatusDescription);
- Stream data = response.GetResponseStream();
- Console.Write(data);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement