串口通讯系列六-串口与上位机通讯调用Flash及Flash视频切换(非交互)

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.IO.Ports;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace SerialFlash
{
    public partial class Form1 : Form
    {
        public Form1() {
            InitializeComponent();
        }

        private SerialPort ComDevice;

        string path = Application.StartupPath + "\\" + "系统文件" + ".txt";

        string path1 = System.Windows.Forms.Application.StartupPath + "\\Flash\\" + "1" + ".swf";
        string path2 = System.Windows.Forms.Application.StartupPath + "\\Flash\\" + "2" + ".swf";
        string path3 = System.Windows.Forms.Application.StartupPath + "\\Flash\\" + "3" + ".swf";
        string path4 = System.Windows.Forms.Application.StartupPath + "\\Flash\\" + "4" + ".swf";
        string path5 = System.Windows.Forms.Application.StartupPath + "\\Flash\\" + "5" + ".swf";

        //声明
        string Mode;
        string PortName;
        string BaudRate;
        string ParityBit;
        string DataBits;
        string StopBit;

        private void Form1_Load(object sender, EventArgs e) {
            DataRead();//读参数
            SerialPortInit();//串口初始化
            ComDevice.DataReceived += CD_DataReceived;//从串口读数据
            ComDevice.Encoding = Encoding.GetEncoding("GB2312");//支持中文
            CheckForIllegalCrossThreadCalls = false;//获取或设置一个值,该值指示是否捕获对错误线程的调用,这些调用在调试应用程序时访问控件的 Handle 属性。
            if(this.Mode == "运行") {
                axShockwaveFlash1.Movie = path1;
                axShockwaveFlash1.Play();
                //实现窗体内某控件的全屏显示  
                this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值