1

I mean for example AsyncGetter method.

req = (HttpWebRequest) WebRequest.Create("http://www.google.com/ig/api?weather=" + city + "&hl=" + lang);
req.Method = "GET";
req.BeginGetResponse(AsyncGetter, req);

When I use F11 it doesn't enter this method.

4

1 回答 1

1

在您的异步回调方法中放置另一个断点,此时无需按 F11(您可以在此时按 F5)并让该方法执行,一旦您得到响应,它将落到您在回调方法中设置的断点。

编辑:

req.BeginGetResponse(new AsyncCallback(AsyncGetter), req);

异步获取器():

private void AsyncGetter(IAsyncResult result){
    HttpWebRequest req = (HttpWebRequest)result.AsyncState;
    ...
}
于 2012-05-13T15:50:41.383 回答