zoukankan      html  css  js  c++  java
  • 使用OpenFileDialog打开文件和使用FolderBrowserDialog选定文件夹

    选定文件夹
    string foldPath = ""; FolderBrowserDialog dialog = new FolderBrowserDialog(); dialog.Description = "请选择文件路径"; dialog.SelectedPath = ""; //dialog.RootFolder = Environment.SpecialFolder.Programs; if (dialog.ShowDialog() == DialogResult.OK) { foldPath = dialog.SelectedPath; } else { return; }

    打开文件

    		OpenFileDialog openFileDialog1 = new OpenFileDialog();
    		string File_Name = "";
    		openFileDialog1.Filter = "所有文件(*.*)|*.*";
    		if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
    		{
    			File_Name = openFileDialog1.FileName;
    
    		}
    		else
    		{
    			return;
    		}
    

    `

  • 相关阅读:
    Python-手动安装第三方包
    SQL SERVER-根据jobID查job
    python-包模块等概念
    锁表
    Python-try异常捕获
    胶水语言
    C++之多态性与虚函数
    android
    开源许可协议
    hal
  • 原文地址:https://www.cnblogs.com/dengzhekaihua/p/15524270.html
Copyright © 2011-2022 走看看