zoukankan      html  css  js  c++  java
  • Winform选择目录路径与选择文件路径

    https://blog.csdn.net/zaocha321/article/details/52528279

    • using System.Collections.Generic;
    • using System.ComponentModel;
    • using System.Data;
    • using System.Drawing;
    • using System.Text;
    • using System.Windows.Forms;
    • namespace WindowsApplication1 {
    • public partial class SelectFolder: Form {
    • public SelectFolder()
    • {
    • InitializeComponent();
    • }
    • private void btnSelectPath_Click(object sender, EventArgs e) //弹出一个选择目录的对话框
    • {
    • FolderBrowserDialog path = new FolderBrowserDialog();
    • path.ShowDialog();
    • this.txtPath.Text = path.SelectedPath;
    • }
    • private void btnSelectFile_Click(object sender, EventArgs e) //弹出一个选择文件的对话框
    • {
    • OpenFileDialog file = new OpenFileDialog();
    • file.ShowDialog();
    • this.txtFile.Text = file.SafeFileName;
    • }
    • }
  • 相关阅读:
    (一)maven基本配置,概念,常用命令
    redis 小结
    git 小结
    spring.xml
    servlet web.xml学习笔记
    springmvc小试牛刀
    maven
    springmvc学习笔记1
    springmvcpojo
    springmvc学习笔记
  • 原文地址:https://www.cnblogs.com/LuoEast/p/9871988.html
Copyright © 2011-2022 走看看