Exemple #1
0
 private void SchoolMenu_Load(object sender, EventArgs e)
 {
     foreach (string folder in FileHelper.GetFolders(FileHelper.htmlPath))
     {
         Add(folder, false, false);
     }
     focusedIndex = -1;
     ShowRefresh();
 }
Exemple #2
0
 private void Form4_Load(object sender, EventArgs e)
 {
     try
     {
         ftpfiles = new Dictionary <string, string>();
         string[] folders = FileHelper.GetFolders(FileHelper.htmlPath);
         foreach (string folder in folders)
         {
             string[] files = FileHelper.GetFiles(FileHelper.htmlPath, folder);
             foreach (string file in files)
             {
                 ftpfiles[FileHelper.GetFile(FileHelper.htmlPath, folder, file)] = FileHelper.htmlPath.Replace('\\', '/') + "/" + folder + "/" + file;
             }
         }
         folders = FileHelper.GetFolders(FileHelper.imagePath);
         foreach (string folder in folders)
         {
             if (folder == "demo")
             {
                 continue;
             }
             string[] files = FileHelper.GetFiles(FileHelper.imagePath, folder);
             foreach (string file in files)
             {
                 ftpfiles[FileHelper.GetFile(FileHelper.imagePath, folder, file)] = FileHelper.imagePath.Replace('\\', '/') + "/" + folder + "/" + file;
             }
         }
         progressBar1.Maximum = ftpfiles.Count;
         Text = "资料上传[" + progressBar1.Value + "/" + progressBar1.Maximum + "]";
         if (ftpfiles.Count == 0)
         {
             button1.Enabled = false;
         }
     }
     catch (Exception ex)
     {
         label1.Text     = ex.Message;
         button1.Enabled = false;
     }
 }