【发布时间】:2013-03-19 22:22:59
【问题描述】:
我为 android 开发了一个向服务器发送请求的应用程序,我在 Android 中的代码如下:
DefaultHttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("www.something.com");
List<NameValuePair> values = new ArrayList<NameValuePair>();
values.add(new BasicNameValuePair("username", user));
values.add(new BasicNameValuePair("password", password));
values.add(new BasicNameValuePair("login-form-type", "pwd"));
httppost.setEntity(new UrlEncodedFormEntity(values, HTTP.UTF_8));
HttpResponse response = httpclient.execute(httppost);
HttpEntity entity = response.getEntity();
List<Cookie> cookies = httpclient.getCookieStore().getCookies();
我尝试了一些示例,但似乎即使在 Visual Studio 2012 中的标准 C# 代码在 Windows 应用商店应用程序中也无法正常工作 谁能帮助我了解此代码在 Windows 8 应用商店应用程序中的工作方式。
非常感谢您的帮助。
最好的问候。
【问题讨论】:
标签: c# android windows windows-8