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

    using System.IO;

            string fileName;
            String extendedName;
            String fileName1;

            private void button1_Click(object sender, EventArgs e)
            {
                OpenFileDialog ofd = new OpenFileDialog();                //new一个方法
                ofd.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); //定义打开的默认文件夹位置
                ofd.ShowDialog();          //显示打开文件的窗口
                fileName = ofd.FileName;                //获得选择的文件路径
                extendedName = Path.GetExtension(fileName);       //获得文件扩展名
                fileName1 = Path.GetFileName(fileName);
            }

  • 相关阅读:
    md5加密(4)
    生成短的uuid
    九九乘法
    闰年判断
    初识网络传输
    省选模拟77
    省选模拟76
    省选模拟75
    省选模拟74
    省选模拟73
  • 原文地址:https://www.cnblogs.com/taikongbai/p/3578683.html
Copyright © 2011-2022 走看看