如果我得到一些错误,我需要返回 null。但这抛出,
IAsyncResult returned from Begin method is null.
这是我的代码?
try
{
var url = (string)state;
var request = (HttpWebRequest)WebRequest.Create(url);
return request.BeginGetResponse(cb, request);
}
catch (Exception ex)
{
}
return null;
如何返回空的 IAsyncResult?