來自m $網站。我沒有得到+ = o,那是什麼?關於匿名功能的語法問題
private void GetResponse(Uri uri, Action<Response> callback)
{
WebClient wc = new WebClient();
wc.OpenReadCompleted += (o, a) =>
{
if (callback != null)
{
DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(Response));
callback(ser.ReadObject(a.Result) as Response);
}
};
wc.OpenReadAsync(uri);
}
我建議你閱讀代表,事件和lambda表達式,這應該只是關於它。 – juharr
[瞭解C#中的事件和事件處理程序]的可能的重複(https://stackoverflow.com/questions/803242/understanding-events-and-event-handlers-in-c-sharp) –