示例#1
0
 /// <summary>
 /// 设置FTP对象信息
 /// </summary>
 private static void SetFtpConfigInfo()
 {
     ftpList = (FTPConfigInfoCollection)Serializer.Load(typeof(FTPConfigInfoCollection), m_configfilepath);
     FTPConfigInfoCollection.FTPConfigInfoCollectionEnumerator ftps = ftpList.GetEnumerator();
     //遍历集合并设置相应的FTP信息(静态)对象
     while (ftps.MoveNext())
     {
         if (ftps.Current.Default == 1 && ftps.Current.Enable == 1)
         {
             currentFtp = ftps.Current;
             break;
         }
     }
 }
示例#2
0
 /// <summary>
 /// Gets a value indicating whether the collection contains the specified <see cref="FTPConfigInfoCollection">FTPConfigInfoCollection</see>.
 /// </summary>
 /// <param name="value">The <see cref="FTPConfigInfoCollection">FTPConfigInfoCollection</see> to search for in the collection.</param>
 /// <returns><b>true</b> if the collection contains the specified object; otherwise, <b>false</b>.</returns>
 public bool Contains(FTPConfigInfo value)
 {
     return(this.List.Contains(value));
 }
示例#3
0
 public int Add(FTPConfigInfo value)
 {
     return(this.List.Add(value));
 }
示例#4
0
 public void Remove(FTPConfigInfo value)
 {
     List.Remove(value);
 }
示例#5
0
 public void Insert(int index, FTPConfigInfo value)
 {
     List.Insert(index, value);
 }
示例#6
0
 /// <summary>
 /// Gets the index in the collection of the specified <see cref="FTPConfigInfoCollection">FTPConfigInfoCollection</see>, if it exists in the collection.
 /// </summary>
 /// <param name="value">The <see cref="FTPConfigInfoCollection">FTPConfigInfoCollection</see> to locate in the collection.</param>
 /// <returns>The index in the collection of the specified object, if found; otherwise, -1.</returns>
 public int IndexOf(FTPConfigInfo value)
 {
     return(this.List.IndexOf(value));
 }
示例#7
0
        ///// <summary>
        ///// 获取配置类实例
        ///// </summary>
        ///// <returns></returns>
        //public static FTPConfigInfo GetConfig()
        //{
        //    return FTPConfigFileManager.LoadConfig();
        //}

        /// <summary>
        /// 保存配置类实例
        /// </summary>
        /// <param name="emailconfiginfo"></param>
        /// <returns></returns>
        public static bool SaveConfig(FTPConfigInfo ftpconfiginfo)
        {
            Serializer.Save(ftpconfiginfo, m_configfilepath);
            return(true);
        }
示例#8
0
 /// <summary>
 /// 初始化文件修改时间和对象实例
 /// </summary>
 static FTPConfigFileManager()
 {
     m_fileoldchange = System.IO.File.GetLastWriteTime(ConfigFilePath);
     m_configinfo    = (FTPConfigInfo)DefaultConfigFileManager.DeserializeInfo(ConfigFilePath, typeof(FTPConfigInfo));
 }