示例#1
0
 public adresSuggestion( adresSuggestionDelegate callback, string proxyUrl = ""  , int port = 80, int timeout= 5000)
 {
     if (proxyUrl == null || proxyUrl == "" )
     {
         client = new gpWebClient() { Encoding = System.Text.Encoding.UTF8 , timeout = timeout};
     }
     else {
         client = new gpWebClient() { Encoding = System.Text.Encoding.UTF8,
                                      Proxy = new System.Net.WebProxy(proxyUrl, port),
                                      timeout = timeout };
     }
     client.Headers["Content-type"] = "application/json";
     client.DownloadStringCompleted += new DownloadStringCompletedEventHandler(callback);
 }