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的编码工作中。
  • 相关阅读:
    CSS Sprite笔记
    前端分页页码静态部分制作
    有趣的网页小部件笔记
    Lintcode 85. 在二叉查找树中插入节点
    Lintcode 166. 主元素
    网页失去焦点标题变化效果
    Lintcode 166. 链表倒数第n个节点
    Lintcode 157. 判断字符串是否没有重复字符
    Lintcode 175. 翻转二叉树
    Lintcode 372. O(1)时间复杂度删除链表节点
  • 原文地址:https://www.cnblogs.com/miniarcher/p/9976861.html
Copyright © 2011-2022 走看看