要求点击 文件列表中的文件名称,即打开该文件,可能是ppt/word/视频等。
本人菜鸟,请各路大虾帮忙解决一下,谢谢。

解决方案 »

  1.   

    经过一番折腾,终于在朋友的帮助下搞定,在此把代码贴出来,与大家分享!
    //第一种:打开word代码
           /*     object oMissing = System.Reflection.Missing.Value;
                Word._Application oWord;
                Word._Document oDoc;
                oWord = new Word.Application();
                oWord.Visible = true;
                object fileName = @"D:\模式对话框.doc";
                oDoc = oWord.Documents.Open(ref fileName,
                ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,
                ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,
                ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing);
                *///第二种万能方法:打开所有的文件的 代码,包括word/ppt/txt/xls/mp3/视频文件
                string fileName = @"D:\新建 文本文档.txt";//路径自己可以换成ppt、mp3、wmv、jpg、rmvb等等格式的文件,都可以
                Process.Start(fileName.ToString());*/
      

  2.   

    对了,第一种方法需要添加相应word的引用,Microsoft Word 11.0 Object Library (OFFICE 2003——>dl版本8.3).
      

  3.   

    string fileName = @"D:\新建 文本文档.txt";//路径自己可以换成ppt、mp3、wmv、jpg、rmvb等等格式的文件,都可以
      Process.Start(fileName.ToString());*/这个方法是 万能的,希望大家使用。