私はWebRequest
コードで a を使用しています:
bool error = false;
WebException exc = null;
statusText.Text = "Starting";
String urlRequest = "http://****PRIVATER URL****/CC/runCode.php?lang=";
urlRequest += global.language;
urlRequest += "&code=";
urlRequest += Uri.EscapeDataString(global.codeString);
statusText.Text = "Requesting";
webRequest = WebRequest.Create(urlRequest);
webRequest.Proxy = null;
//webRequest.BeginGetResponse(new AsyncCallback(webRequestDone), null);
try
{
using (resp = await webRequest.GetResponseAsync())
{
//TODO get this working!
}
}
catch (WebException e)
{
error = true;
exc = e;
}
if (error)
{
await new Windows.UI.Popups.MessageDialog(exc.Message).ShowAsync();
}
プロキシを使用せずに Web サーバーにアクセスできます。句の外で応答を取得した場合try catch
、以下のように問題なく実行されます。
bool error = false;
WebException exc = null;
statusText.Text = "Starting";
String urlRequest = "http://****PRIVATE URL****/CC/runCode.php?lang=";
urlRequest += global.language;
urlRequest += "&code=";
urlRequest += Uri.EscapeDataString(global.codeString);
statusText.Text = "Requesting";
webRequest = WebRequest.Create(urlRequest);
webRequest.Proxy = null;
//webRequest.BeginGetResponse(new AsyncCallback(webRequestDone), null);
resp = await webRequest.GetResponseAsync();