zoukankan      html  css  js  c++  java
  • 11.17 个人总结

    今天开始编写button浏览中的代码,

         private void button1_Click(object sender, EventArgs e)
            {
                if(this.openFileDialog1.ShowDialog()==DialogResult.OK)
                {
                    this.listView1 .Items .Clear();
                    string[] FileNames = this.openFileDialog1.FileNames;
                    foreach (string FileName in FileNames )
                    {
                        FileInfo MyFileInfo = new FileInfo(FileName);
                        float MyFileSize = (float)MyFileInfo.Length / (1024 * 1024);//取得文件大小
                        this.axWindowsMediaPlayer1.FileName= FileName;
                        string MyAuthor = this.axWindowsMediaPlayer1.GetMediaInfoString(MediaPlayer.MPMediaInfoType.mpClipAuthor);//作者信息
                        string MyShortFileName = FileName.Substring(FileName.LastIndexOf("\") + 1);
                        MyShortFileName = MyShortFileName.Substring(0, MyShortFileName.Length - 4);//不含路径的文件名
                        string[] SubItem = { MyShortFileName, MyAuthor, MyFileSize.ToString().Substring(0, 4) + "M", FileName };
                        ListViewItem Item = new ListViewItem(SubItem);
                        this.listView1.Items.Add(Item);
                        this.listView1.Items[0].Selected = true;//填充在list view中
                    }
                }
            }
     
    代码大致是以上所述,
    发现在每一个变量在使用之前都需要声明,相当于告诉系统将要使用这个东西,然后就可以告诉这个变量如何获得,最终将计算后的东西赋值到你想要的位置即可。但是今天的编程发生了一些小问题,播放器的地址与代码有点不能相联系起来,导致button1的功能不能运行,因为时间关系,今天的问题暂不解决,明天将抽出时间来解决这一点,然后进行播放button的编码工作中。
  • 相关阅读:
    SQL大语句——实现分页,select top后面跟变量出错
    jQuery异步请求(如getJSON)跨域解决方案
    Debug常用命令
    清华操作系统实验--80x86汇编基础
    在Windows10中运行debug程序
    恢复Windows10应用商店
    最少硬币问题
    嵌套矩形问题
    清华大学操作系统实验准备--挖坑
    动态规划入门-数字三角形
  • 原文地址:https://www.cnblogs.com/miniarcher/p/9976861.html
Copyright © 2011-2022 走看看