1
我有一個CF 2.0項目中,我需要執行如下的內容:Web客戶端在.NET Compact Framework 2.0中
var myList = new List<MyItem>() { item1, item2 };
using (var webclient = new WebClient())
{
webclient.Headers["Content-type"] = "application/json";
webclient.Encoding = Encoding.UTF8;
var data = JsonConvert.SerializeObject(myList);
var response = webclient.UploadString("http://111.111.111.111:8762/MyService/FetchData", "POST", data);
var myItems = JsonConvert.DeserializeObject(response, typeof(List<MyItem>));
}
在CF 2.0我找不到System.Net.WebClient
http://social.msdn.microsoft.com/Forums/en-US/4b491101-897a-43d3-9ec9-b1c2140b1da2/webclient-class-in-compact-framework?forum=netfxcompact – Habib 2014-09-05 16:12:33