| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using UAS_MES.PublicMethod;
- namespace UAS_MES.Query
- {
- public partial class Query_ShowInstruction : Form
- {
- //文件具体地址
- string type = "";
- public Query_ShowInstruction(string FileType)
- {
- InitializeComponent();
- MediaPlayer.PlayStateChange += MediaPlayer_PlayStateChange;
- type = FileType;
- StartPosition = FormStartPosition.CenterScreen;
- }
- private void MediaPlayer_PlayStateChange(object sender, AxWMPLib._WMPOCXEvents_PlayStateChangeEvent e)
- {
- if ((int)MediaPlayer.playState == 1)
- {
- System.Threading.Thread.Sleep(1000);
- MediaPlayer.Ctlcontrols.play();
- }
- }
- private void Quert_ShowInstruction_Load(object sender, EventArgs e)
- {
- switch (BaseUtil.GetFileSuffix(type))
- {
- case "MP4":
- MediaPlayer.Visible = true;
- PageView.Visible = false;
- PicBox.Visible = false;
- MediaPlayer.URL = type;
- MediaPlayer.Ctlcontrols.play();
- break;
- case "PDF":
- MediaPlayer.Visible = false;
- PageView.Visible = true;
- PDFDocument.FilePath = type;
- PicBox.Visible = false;
- break;
- case "JPEG":
- MediaPlayer.Visible = false;
- PageView.Visible = false;
- PicBox.Visible = true;
- break;
- case "JPG":
- MediaPlayer.Visible = false;
- PageView.Visible = false;
- PicBox.Visible = true;
- break;
- default:
- break;
- }
- }
- }
- }
|