zoukankan      html  css  js  c++  java
  • 打开文件,文件夹

    1. private void btnFile_Click(object sender, EventArgs e)  
    2. {  
    3. OpenFileDialog fileDialog = new OpenFileDialog();  
    4. fileDialog.Multiselect = true;  
    5. fileDialog.Title = "请选择文件";  
    6. fileDialog.Filter="所有文件(*.*)|*.*";  
    7. if (fileDialog.ShowDialog() == DialogResult.OK)  
    8. {  
    9. string file=fileDialog.FileName;  
    10. MessageBox.Show("已选择文件:" + file,"选择文件提示",MessageBoxButtons.OK,MessageBoxIcon.Information);  
    11. }  
    12. }  
    13.   
    14. private void btnPath_Click(object sender, EventArgs e)  
    15. {  
    16. FolderBrowserDialog dialog = new FolderBrowserDialog();  
    17. dialog.Description = "请选择文件路径";  
    18. if (dialog.ShowDialog() == DialogResult.OK)  
    19. {  
    20. string foldPath = dialog.SelectedPath;  
    21. MessageBox.Show("已选择文件夹:" + foldPath, "选择文件夹提示", MessageBoxButtons.OK, MessageBoxIcon.Information);  
    22. }  
    23. }  
    24.   
    25. private void btnOpen_Click(object sender, EventArgs e)  
    26. {  
    27. System.Diagnostics.Process.Start("Explorer.exe","c:\windows");  
    28. }  
  • 相关阅读:
    黑胶100
    界面滑动+ztree
    Linux下Java获取本机IP地址
    垂直对齐vertical-align:top
    针对jquery获取表单数据并且迭代方式
    js传递参数中文乱码
    前端开发资源库
    webpack加载器(Loaders)
    webpack基础知识点
    webpack操作基础
  • 原文地址:https://www.cnblogs.com/zhangruifeng/p/5975830.html
Copyright © 2011-2022 走看看