vs2003中
AxWindowsMediaPlayer控件有FileName属性吗?
用下列语句
axWindowsMediaPlayer1.currentMedia = axWindowsMediaPlayer1.newMedia(OpenFileDialog.FileName);
axWindowsMediaPlayer1.Ctlcontrols.play();
可显示下面错误:
C:\Documents and Settings\Administrator\My Documents\Visual Studio Projects\WindowsApplication12\WindowsApplication12\Form1.cs(131): 非静态的字段、方法或属性“System.Windows.Forms.FileDialog.FileName”要求对象引用
该怎么办,请各位大哥帮帮忙,小弟不胜感激.
AxWindowsMediaPlayer控件有FileName属性吗?
用下列语句
axWindowsMediaPlayer1.currentMedia = axWindowsMediaPlayer1.newMedia(OpenFileDialog.FileName);
axWindowsMediaPlayer1.Ctlcontrols.play();
可显示下面错误:
C:\Documents and Settings\Administrator\My Documents\Visual Studio Projects\WindowsApplication12\WindowsApplication12\Form1.cs(131): 非静态的字段、方法或属性“System.Windows.Forms.FileDialog.FileName”要求对象引用
该怎么办,请各位大哥帮帮忙,小弟不胜感激.
应该是这样写吧:OpenFileDialog ofd = new OpenFileDialog();
ofd.ShowDialog();
...newMedia(ofd.FileName);