Ejemplo n.º 1
0
        public void MakeRequest(string url, Action<bool, string> callback)
        {
            WebRequest request = WebRequest.Create(url);
            RequestState state = new RequestState();
            state.Request = request;
            state.Callback = callback;
            ((HttpWebRequest)request).UserAgent = "SuperPutty/1.4.0.5";

            IAsyncResult result = (IAsyncResult)request.BeginGetResponse(
         new System.AsyncCallback(RespCallback), state);
        }
Ejemplo n.º 2
0
        public void MakeRequest(string url, Action<bool, string> callback)
        {
            WebRequest request = WebRequest.Create(url);
            RequestState state = new RequestState
            {
                Request = request,
                Callback = callback
            };
            ((HttpWebRequest)request).UserAgent = "SuperPuTTY/" + Assembly.GetExecutingAssembly().GetName().Version;

            IAsyncResult result = (IAsyncResult)request.BeginGetResponse(new AsyncCallback(RespCallback), state);
        }