Пример #1
0
        /// <summary> 加载从通达信导出的数据文件
        /// </summary>
        private string LoadFileList_exportFile()
        {
            string retVal       = string.Empty;
            string sourceFolder = txtSourceFolder.Text;

            if (Directory.Exists(sourceFolder))
            {
                AllFile.Clear();
                DirectoryInfo dicInfo = new DirectoryInfo(sourceFolder);

                foreach (FileInfo fileInfo in dicInfo.GetFiles())
                {
                    //隐藏文件和系统文件就不要过来凑热闹了
                    if ( /*( fileInfo.Attributes & FileAttributes.Hidden ) == FileAttributes.Hidden || */
                        (fileInfo.Attributes & FileAttributes.System) == FileAttributes.System)
                    {
                        continue;
                    }

                    AllFile.Add(fileInfo);
                }

                //一行一行显示文件名
                retVal = CommFunction.StringList2String(AllFile.Select(f => f.FullName).ToList());
            }
            else
            {
                CommFunction.WriteMessage("文件夹不存在!");
            }

            return(retVal);
        }
Пример #2
0
 private void SaveConfig()
 {
     try
     {
         SysConfig.WriteConfigData("AppConfig", "SourceFolder", txtSourceFolder.Text);
     }
     catch (Exception ex)
     {
         CommFunction.WriteMessage(ex.Message);
     }
 }
Пример #3
0
 private void LoadConfig()
 {
     try
     {
         CommFunction.LoadAllConfig();
         txtSourceFolder.Text = CommProp.SourceFolder;
     }
     catch (Exception ex)
     {
         CommFunction.WriteMessage(ex.Message);
     }
 }