0
如何創建匿名函數類型?我使用「無效」作爲填充類型:Windows Phone 7的匿名C#函數
private void afte(string filtr,void parse) {
var request = (HttpWebRequest)WebRequest.Create(
new Uri("xx.com"));
request.BeginGetResponse(r => {
var httpRequest = (HttpWebRequest)r.AsyncState;
var httpResponse = (HttpWebResponse)httpRequest.EndGetResponse(r);
using (var reader = new StreamReader(httpResponse.GetResponseStream())) {
var response = reader.ReadToEnd();
Deployment.Current.Dispatcher.BeginInvoke(new Action(() => {
parse(response);
}));
}
}, request);
}
私人無效解析(字符串SS){} – SevenDays
必須你的'AFTE()'方法需要符合任何接口或委託本身?如果沒有,你可以給它一個參數('字符串filtr')。 – BoltClock
謝謝。你說得對。 – SevenDays