zoukankan      html  css  js  c++  java
  • 博客开通第十九天

    //添加按钮
    private void btnAdd_Click(object sender, EventArgs e)
    {
    DialogResult result = openFileDialog.ShowDialog();
    if (DialogResult.OK == result)
    {
    string filepath = openFileDialog.FileName;//文件所在路径
    FileInfo fileInfo = new FileInfo(filepath);//文件信息
    string fileName = fileInfo.Name;//
    string fileType = fileName.Split('.')[1];

    DataGridViewRow row = new DataGridViewRow();
    row.CreateCells(dataGridView1, new string[] { fileName.Split('.')[0], fileType, filepath });//把文件名称,类型,路径填充到gridview中。
    this.dataGridView1.Rows.Add(row);

    }
    }

    点击添加按钮出现下图:

    选中一个图标,点击打开显示下图:

    完成,还可以继续添加。

  • 相关阅读:
    跨域问题
    window7_64+python3.6安装Twisted
    resful协议1
    Http状态码
    数据库学习笔记
    linux学习笔记
    前端学习笔记
    python学习笔记
    mongoDB
    git的使用方法
  • 原文地址:https://www.cnblogs.com/licc09/p/3012140.html
Copyright © 2011-2022 走看看