欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

.net 打开文件

程序员文章站 2022-04-01 16:51:25
...
 OpenFileDialog^ dlgOpenFile = gcnew OpenFileDialog ();
String^ fileName;
dlgOpenFile->InitialDirectory = "D:\\";
dlgOpenFile->Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*";
dlgOpenFile->FilterIndex = 1;
dlgOpenFile->RestoreDirectory = true ;
dlgOpenFile->ShowDialog();
fileName = dlgOpenFile->FileName;
TB_Path->Text = fileName;