On Apr 2, 2013, at 7:04 PM, Stephan Steiner <[email protected]> wrote:
> I just sent this to Bryan -
>
> Try https://www.google.com/
>
> Still bombs out.
Still unable to reproduce. Is this a Debug or a Release app? If a Release app,
perhaps you need to enable the INTERNET permission?
Is this on hardware or the emulator? If the emulator, has the network been
disabled (F8 enables/disables)?
The following Works For Me™.
- Jon
using System;
using System.Net;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
using Android.App;
using Android.Runtime;
using Android.Widget;
using Android.OS;
namespace Scrach.NewBcl
{
[Application]
public class MyAp : Android.App.Application {
public MyAp (IntPtr handle, JniHandleOwnership transfer)
: base (handle, transfer)
{
}
public override void OnCreate ()
{
ServicePointManager.ServerCertificateValidationCallback =
validatedCertificate;
}
private bool validatedCertificate(object sender, X509Certificate
certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
{
return true;
}
}
[Activity (Label = "Scrach.NewBcl", MainLauncher = true)]
public class Activity1 : Activity
{
int count = 1;
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
// 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 += button_Click;
}
void button_Click(object sender, EventArgs e)
{
((Button)sender).Text = string.Format ("{0} clicks!", count++);
// var uri = new Uri
(@"https://wsklo2059.dragonslair.net:8090/IsAlive/");
// var uri = new Uri ("https://balthasar.jprl.com");
var uri = new Uri ("https://www.google.com/");
HttpWebRequest req = new HttpWebRequest (uri);
WebResponse res = req.GetResponse();
}
}
}
_______________________________________________
Monodroid mailing list
[email protected]
UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid