zoukankan      html  css  js  c++  java
  • winfrom 通过按钮选择文件

     private void ExcelBtn_Click(object sender, EventArgs e)
            {
                using (OpenFileDialog ofd = new OpenFileDialog())
                {
                    ofd.Filter = " Excel文件|*.xls";
                    if (ofd.ShowDialog() == DialogResult.OK)
                    {               
                        this.ExcelText.Text = ofd.FileName;
                    }
                }
            }

     //选择保存文件路径
            private void PutBtn_Click(object sender, EventArgs e)
            {
                using (SaveFileDialog sfd = new SaveFileDialog())
                {
                    sfd.Filter = "(*.xlsx)|*.xlsx";
                    sfd.Title = "结果输出:";
                    if (sfd.ShowDialog() == DialogResult.OK)
                    {
                        this.TB_Put.Text = sfd.FileName;
                    }
                }
            }
  • 相关阅读:
    C++ STL中vector应用
    cocos2dx绘制直线
    [ios] 获得ios设备具体型号
    如何制作 iTunesArtwork
    Ios AppIcon 去掉默认半弧形白色遮罩
    App运行内存打印
    C++ 文件操作
    objc 笔记
    (转)c++ oc字符操作
    cocos2dx 文本 优化
  • 原文地址:https://www.cnblogs.com/nxj1997/p/13225806.html
Copyright © 2011-2022 走看看