我已经用android做了这个。现在我正在尝试在 Windows Phone 7 中执行此操作。此代码在 c# 中的等效项是什么?我还想将源代码保存在字符串中。
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("http://students.usls.edu.ph/login.cfm");
username = txtUname.getText().toString();
password = txtPass.getText().toString();
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2);
nameValuePairs.add(new BasicNameValuePair("username",username));
nameValuePairs.add(new BasicNameValuePair("password",password));
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));