c# 在 Windows Media Player 中播放电影“不”嵌入式
我环顾四周,发现的一切都在谈论嵌入它。
我不想嵌入它。我想单击一个按钮并单独启动 Windows Media Player。
例如,我有一个保存在 XML 文件中的位置。我右键点击“播放”。它会拉出位置。像这样。
int dd = dataGridView1.CurrentRow.Index;
string eLoc = dataGridView1.Rows[dd].Cells[4].Value.ToString();
if (eLoc == "")
{
MessageBox.Show("You have not saved a location for this movie","Movie Play",MessageBoxButtons.OK,MessageBoxIcon.Information);
}
else
{
MessageBox.Show(eLoc);
ProcessStartInfo ps = new ProcessStartInfo("wmplayer.exe", eLoc.ToString());
Process.Start(ps);
}
如您所见,我有一个弹出窗口可以查看字符串是什么。
就是这个。我添加了 %20 来替换空格,以为这是问题所在,但事实并非如此。
如您所见,它提取了完整的位置。我从 Windows Media Player 得到的只是这个。
有什么想法吗?对我来说这似乎应该有效..
I have looked around, everything I find is talking about embedding it.
I do not want to embed it. I want to click a button and launch windows media player seperatly.
For example, I have a location saved in XML file. I have a right click to click Play. It pulls the location. like so.
int dd = dataGridView1.CurrentRow.Index;
string eLoc = dataGridView1.Rows[dd].Cells[4].Value.ToString();
if (eLoc == "")
{
MessageBox.Show("You have not saved a location for this movie","Movie Play",MessageBoxButtons.OK,MessageBoxIcon.Information);
}
else
{
MessageBox.Show(eLoc);
ProcessStartInfo ps = new ProcessStartInfo("wmplayer.exe", eLoc.ToString());
Process.Start(ps);
}
As you can see, I have a pop up to view, what the string is.
It is this. I added %20 to replace spaces, thinking that was the problem but it isn't.
As you can see it pulls the full location. All I get back from windows media player is this.
Any ideas? To me it seems like this should be working..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我现在已经可以使用了。是空格导致了错误,我改成了这个,现在工作完美了。
I got it working now. It was the spaces causing the errors, I changed to this, and works perfect now.
它应该可以工作,事实上在我的计算机上并且使用不同的路径它确实可以工作,我怀疑该文件像 jfs 建议的那样已损坏。
It should be working, in fact on my computer and with a different path it does work, I suspect the file is damaged like jfs suggested.