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. }  
  • 相关阅读:
    scapy-python
    多进程和多线程
    Python函数
    while循环
    打印print的另一种方式sys.stdout
    python3 pickle & struct
    正则表达式
    【牛客网刷题】两种排序方法
    使用Python matplotlib做动态曲线
    【牛客网刷题】一次难忘的编程教训
  • 原文地址:https://www.cnblogs.com/zhangruifeng/p/5975830.html
Copyright © 2011-2022 走看看