コード例 #1
0
 public static FTPProperties GetFTPProperties()
 {
     try
     {
         if (!System.IO.Directory.Exists(globalVariables.m_strPropertiesFolder))
         {
             Directory.CreateDirectory(globalVariables.m_strPropertiesFolder);
         }
         var    myProperty = new FTPProperties();
         string filePath   = string.Format(@"{0}\{1}.xml", globalVariables.m_strPropertiesFolder, myProperty.GetType().Name);
         if (!File.Exists(filePath))
         {
             return(myProperty);
         }
         var myFileStream = new FileStream(filePath, FileMode.Open);
         var mySerializer = new XmlSerializer(myProperty.GetType());
         myProperty = (FTPProperties)mySerializer.Deserialize(myFileStream);
         myFileStream.Close();
         return(myProperty);
     }
     catch (Exception ex)
     {
         return(new FTPProperties());
     }
 }
コード例 #2
0
 public FTPConfigureDlg(bool l_bStatus, FTPProperties l_FTPProperties)
 {
     //
     // Required for Windows Form Designer support
     //
     InitializeComponent();
     //
     // TODO: Add any constructor code after InitializeComponent call
     //
     m_FTPProperties = l_FTPProperties;
     if (l_bStatus == true)
     {
         m_tbFTPPort.Enabled        = true;
         m_cBServerOS.SelectedIndex = 2;
     }
     else
     {
         m_tbFTPPort.Enabled  = false;
         m_cBServerOS.Enabled = false;
     }
     m_rBASCIIMode.Checked      = true;
     m_rBBinaryMode.Enabled     = false;
     m_nUDSendTimeOut.Enabled   = true;
     m_nUDRecvTimeOut.Enabled   = true;
     m_tbFTPPort.Text           = m_FTPProperties.Port.ToString();
     m_cBServerOS.SelectedIndex = m_FTPProperties.ServerTypeIndex;
     m_nUDSendTimeOut.Value     = m_FTPProperties.SendTimeOut;
     m_nUDRecvTimeOut.Value     = m_FTPProperties.RecvTimeOut;
 }
コード例 #3
0
        public FTPConnectDlg(FTPProperties l_ftpProperties)
        {
//
// Required for Windows Form Designer support
//
            InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
            m_FTPProperties    = l_ftpProperties;
            m_tbFTPServer.Text = m_FTPProperties.FTPServer;
            m_tbUserID.Text    = m_FTPProperties.UserID;
            m_tbPassword.Text  = m_FTPProperties.Password;
        }