从文件夹播放视频 [英] Video play from folder
本文介绍了从文件夹播放视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
专家,
我想按顺序从文件夹中播放多个视频文件。目前我可以播放一个文件。
我的编码
使用系统;
使用System.Collections.Generic;使用System.ComponentModel
;
使用System.Data;使用System.Drawing
;
使用System.Linq;
使用System.Text;
使用System.Threading.Tasks;
使用System.Windows.Forms;
命名空间Daily_Order_System
{
公共部分类Form2:CustomForm
{
public Form2()
{
InitializeComponent();
}
protected override void OnStart(CustomForm Sender)
{
//axWindowsMediaPlayer1.Ctlcontrols.play();
axWindowsMediaPlayer1.Ctlcontrols.play();
}
//当表格被最小化时停止播放视频等等
protected override void OnStop(CustomForm Sender)
{
axWindowsMediaPlayer1.Ctlcontrols.pause();
}
private void Form2_Load(object sender,EventArgs e)
{
axWindowsMediaPlayer1.URL = @" C:\ Users \ Downloads\ok.mp4英寸;
//axWindowsMediaPlayer1.settings.autoStart = true;
}
private void axWindowsMediaPlayer1_Enter(object sender,EventArgs e)
{
axWindowsMediaPlayer1.Dock = DockStyle.Fill;
}
private void button1_Click(object sender,EventArgs e)
{
this.WindowState = FormWindowState。最小化;
Form1 f = new Form1(); //这是坏的
f.Show();
timer1.Enabled = true;
}
private void timer1_Tick(object sender,EventArgs e)
{
button1.PerformClick();
}
}
}
要求
想要播放文件夹中的视频文件c:\ video>
解决方案
Hi Losio1,
欢迎来到MSDN论坛。
请参阅您的说明,您的问题与Windows窗体有关发展。由于我们的论坛是讨论VS IDE,我将帮助您将此主题移至相应的论坛以获得更好的支持,感谢您的理解。
致以最诚挚的问候,
Sara
Experts,
I would like to play multiple video file from the folder by sequence. At the moment one file i am able to play.
my codings
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace Daily_Order_System { public partial class Form2 : CustomForm { public Form2() { InitializeComponent(); } protected override void OnStart(CustomForm Sender) { //axWindowsMediaPlayer1.Ctlcontrols.play(); axWindowsMediaPlayer1.Ctlcontrols.play(); } // To stop playing video and etc when form being minimized protected override void OnStop(CustomForm Sender) { axWindowsMediaPlayer1.Ctlcontrols.pause(); } private void Form2_Load(object sender, EventArgs e) { axWindowsMediaPlayer1.URL = @"C:\Users\Downloads\ok.mp4"; //axWindowsMediaPlayer1.settings.autoStart = true; } private void axWindowsMediaPlayer1_Enter(object sender, EventArgs e) { axWindowsMediaPlayer1.Dock = DockStyle.Fill; } private void button1_Click(object sender, EventArgs e) { this.WindowState = FormWindowState.Minimized; Form1 f = new Form1(); // This is bad f.Show(); timer1.Enabled = true; } private void timer1_Tick(object sender, EventArgs e) { button1.PerformClick(); } } }
Requirement
want to play video files from folder c:\video
解决方案
Hi Losio1,
Welcome to the MSDN forum.
Refer to your description, your issue is about the Windows Forms development. Since our forum is to discuss the VS IDE, I will help you move this thread to the appropriate forum for a better support, thank you for your understanding.
Best regards,
Sara
这篇关于从文件夹播放视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文