Пример #1
0
 public static SocketHttpResponse GetRequest(string url)
 {
     using (SocketHttpDataProvider provider = new SocketHttpDataProvider(2))
     {
         SocketHttpRequest request = (SocketHttpRequest)provider.GetRequest(new Uri(url));
         return((SocketHttpResponse)request.GetResponse());
     }
 }
Пример #2
0
 public static SocketHttpResponse GetRequest(string url, string ipAddress)
 {
     using (SocketHttpDataProvider provider = new SocketHttpDataProvider(2))
         using (SocketReference socket = provider.Sockets.GetSocket(new IPEndPoint(IPAddress.Parse(ipAddress), 80)))
         {
             SocketHttpRequest request = (SocketHttpRequest)provider.GetRequest(new Uri(url));
             return((SocketHttpResponse)request.GetResponse(socket.Socket));
         }
 }