문제

스크립트를 HTML 페이지에 "주입"하는 데 사용하는 작은 도우미 앱이 있습니다.

OpenFileDialog Promt가 있고 해당 디렉토리 (1403 파일)에서 모든 HTML 파일을 선택하고 무엇을하든 OFD.filenames.count = 776을 볼 수 있습니다.

한계가 있습니까?

감사해요

OpenFileDialog OFD = new OpenFileDialog();
            OFD.Multiselect = true;
            OFD.Filter = "HTML Files (*.htm*)|*.HTM*|" +
          "All files (*.*)|*.*";

            if (OFD.ShowDialog() == DialogResult.OK)
            {
                progressBar1.Maximum = OFD.FileNames.Count();
                foreach (string s in OFD.FileNames)
                {
                    Console.WriteLine(s);
                    AddAnalytics(s);
                    progressBar1.Value++;
                }
                MessageBox.Show(string.Format("Done! \r\n {0} files completed",progressBar1.Value));
                progressBar1.Value = 0;
            }
도움이 되었습니까?

해결책

OpenFiledialog는 '파일 이름'필드에서 처음 256 자만 사용합니다. 필드 자체는 더 많이 표시되지만 256 자 이후에는 아무것도 무시합니다.

귀하의 경우 누락 된 파일은 256 문자 마크 다음에 나열되어 있다고 생각합니다.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top