예제 #1
0
 public void Save(TcpForwarderSettings settings)
 {
     try
     {
         using (var file = File.OpenWrite(this.fullPath))
         {
             this.ser.Serialize(file, settings);
         }
     }
     catch
     {
     }
 }
예제 #2
0
        protected override void OnClosing(CancelEventArgs e)
        {
            this.Stop();

            var settings = new TcpForwarderSettings();

            settings.SourcePort = this.textBoxSourcePort.Text;
            settings.TargetIP   = this.textBoxTargetIP.Text;
            settings.TargetPort = this.textBoxTargetPort.Text;
            this.tempSettingsManager.Save(settings);

            base.OnClosing(e);
        }