Exemplo n.º 1
0
        protected override async void PerformNavigate()
        {
            try
            {
                var uri      = new Uri(Address);
                var host     = uri.Host;
                var resource = uri.PathAndQuery;
                var port     = uri.Port;

                var sc = new SkClient(host, port);

                var request = RequestFactory.CreateHead(resource);

                using (var ms = new MemoryStream())
                {
                    var response = await sc.ExecuteAsync(request, ms, progressIndicator);

                    Status = response.StatusCode + " " + response.ReasonPhase;

                    Headers.Clear();
                    foreach (var header in response.Headers)
                    {
                        Headers.Add(header.Key + ": " + header.Value);
                    }
                }
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
            }
        }