开发者

WebRequest.Create is a wait until process complete code required?

开发者 https://www.devze.com 2023-03-29 16:16 出处:网络
When using the WebRequest.Create do I have to set a wait/response code before processing the next link. Meaning will WebRequest function auto wait until its complete bef开发者_如何学运维ore processing

When using the WebRequest.Create do I have to set a wait/response code before processing the next link. Meaning will WebRequest function auto wait until its complete bef开发者_如何学运维ore processing the next step or another link?

try
    {
    req = WebRequest.Create(strURL + listId.SelectedItem as string + "&admire=1");
    req.Proxy = proxyObject;
    req.Method = "POST";
    req.Timeout = 5000;
    }
    catch (Exception eq)
    {
    string sErr = "Cannot connect to " + listId.SelectedItem + " : " + eq.Message;
    MessageBox.Show(sErr, strURL, MessageBoxButtons.OK, MessageBoxIcon.Stop);
    }


The GetResponse() method is a synchronous method that will only return after the server sends a reply.

The BeginGetResponse() method is an asynchronous method that will return immediately, before the server replies.

0

精彩评论

暂无评论...
验证码 换一张
取 消