@@ -1285,29 +1285,16 @@ private void SelectPath_Click(object sender, EventArgs e)
12851285 {
12861286 if ( Environment . OSVersion . Version . Major >= 6 ) //操作系统win7及以上才能使用此效果
12871287 {
1288- var fsd = new FolderSelectDialog ( ) ;
1289- //FolderSelectDialog fsd = new FolderSelectDialog();
1288+ FolderSelectDialog fsd = new FolderSelectDialog ( ) ;
12901289 fsd . Title = "请选择pdf所在的文件夹" ;
1291- if ( string . IsNullOrWhiteSpace ( pathText . Text . Trim ( ) ) )
1290+ fsd . InitialDirectory = Environment . GetFolderPath ( Environment . SpecialFolder . Desktop ) ;
1291+ if ( fsd . ShowDialog ( this . Handle ) )
12921292 {
1293- string desktopPath = Environment . GetFolderPath ( Environment . SpecialFolder . Desktop ) ;
1294- fsd . InitialDirectory = desktopPath ; // @"c:\";
1295- }
1296- else
1297- {
1298- //fsd.InitialDirectory = @"c:\";
1299- //fsd.InitialDirectory = appDirecroty;
1300- fsd . InitialDirectory = AppDomain . CurrentDomain . BaseDirectory ; //当前程序的基目录不会变
1301- }
1302- if ( fsd . ShowDialog ( this . Handle ) ) //IntPtr.Zero和this.Handle区别
1303- {
1304- //this.pathText.ForeColor = Color.Black;
1305- //this.pathText.Text = fsd.FileName;
1306- pathText . Text = fsd . InitialDirectory ;
1307- pathDir = fsd . InitialDirectory ;
1293+ pathText . Text = fsd . FileName ;
1294+ pathDir = fsd . FileName ;
13081295 if ( textBCpath . Text == "" )
13091296 {
1310- textBCpath . Text = fsd . InitialDirectory + "\\ QFZ" ;
1297+ textBCpath . Text = fsd . FileName + "\\ QFZ" ;
13111298 }
13121299 dt . Rows . Clear ( ) ;
13131300 dt . Rows . Add ( new object [ ] { "" , "" } ) ;
@@ -1386,21 +1373,20 @@ private void OutPath_Click(object sender, EventArgs e)
13861373 {
13871374 if ( Environment . OSVersion . Version . Major >= 6 ) //操作系统win7及以上才能使用此效果
13881375 {
1389- var fsd = new FolderSelectDialog ( ) ;
1390- //FolderSelectDialog fsd = new FolderSelectDialog();
1376+ FolderSelectDialog fsd = new FolderSelectDialog ( ) ;
13911377 fsd . Title = "请选择保存的文件夹" ;
13921378 if ( string . IsNullOrWhiteSpace ( pathText . Text . Trim ( ) ) )
13931379 {
13941380 string desktopPath = Environment . GetFolderPath ( Environment . SpecialFolder . Desktop ) ;
1395- fsd . InitialDirectory = desktopPath ; // @"c:\";
1381+ fsd . InitialDirectory = desktopPath ;
13961382 }
13971383 else
13981384 {
1399- fsd . InitialDirectory = AppDomain . CurrentDomain . BaseDirectory ; //当前程序的基目录不会变
1385+ fsd . InitialDirectory = pathText . Text ;
14001386 }
1401- if ( fsd . ShowDialog ( this . Handle ) ) //IntPtr.Zero和this.Handle区别
1387+ if ( fsd . ShowDialog ( this . Handle ) )
14021388 {
1403- textBCpath . Text = fsd . InitialDirectory ;
1389+ textBCpath . Text = fsd . FileName ;
14041390 }
14051391 }
14061392 else
0 commit comments