Ejemplo n.º 1
0
 public HttpClient(HttpSettings settings)
 {
     this.InitSetting(settings);
     string path = Path.Combine(Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath), "HttpOption.csv");
     try
     {
         if (System.IO.File.Exists(path))
         {
             using (StreamReader reader = new StreamReader(path, Encoding.UTF8))
             {
                 while (reader.Peek() >= 0)
                 {
                     string[] strArray = reader.ReadLine().Split(new char[] { ',' });
                     if (strArray.Length > 1)
                     {
                         if (strArray[0].Trim().Equals("RetryCount"))
                         {
                             int.TryParse(strArray[1].Trim(), out this.RetryCount);
                         }
                         else if (strArray[0].Trim().Equals("RetryWaitTimer"))
                         {
                             int.TryParse(strArray[1].Trim(), out this.RetryWaitTimer);
                         }
                     }
                 }
             }
         }
     }
     catch
     {
     }
 }
Ejemplo n.º 2
0
 private void HttpSet()
 {
     this.hts_cls = new HttpSettings();
     this.hts_bat = new HttpSettings();
     this.SetMinStatus();
 }
Ejemplo n.º 3
0
 protected void InitSetting(HttpSettings settings)
 {
     this.mBuilder = new ComParamBuilder();
     this.mBuilder.BaseCharset = settings.CharsetString;
     this.mSettings = settings;
     this.mTimer = new System.Timers.Timer();
     this.mTimer.Elapsed += new ElapsedEventHandler(this.TimeoutCallback);
     this.mTimer.Interval = this.mSettings.SendTimeout * 0x3e8;
     this.mTimer.AutoReset = false;
     this.Status = HttpStatus.Idle;
     this.TraceSet();
     if (this.mSettings.UseHttps)
     {
         this.mTracekind = NetTrace.Tracekind.HTTPS;
     }
 }