• 大小: 378.32 KB
    文件类型: .rar
    金币: 2
    下载: 0 次
    发布日期: 2024-08-01
  • 语言: C#
  • 标签:

资源简介

C#版串口蓝牙测试工具

资源截图

代码片段和文件信息

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

namespace Bluetooth_Test
{
    public partial class frmMain : Form
    {
        public frmMain()
        {
            InitializeComponent();

        }

        private void btnOpen_Click(object sender EventArgs e)
        {
            serialPort.PortName=cboPort.Text;
            if (!serialPort.IsOpen)
                serialPort.Open();
        }

        private void btnSend_Click(object sender EventArgs e)
        {
            try
            {
                serialPort.WriteLine(txtSend.Text);
            }
            catch (Exception E)
            {

                MessageBox.Show(E.Message.ToString() “错误……“ MessageBoxButtons.OK MessageBoxIcon.Hand MessageBoxDefaultButton.Button1);
                return;
            }
        }

        private void serialPort_DataReceived(object sender System.IO.Ports.SerialDataReceivedEventArgs e)
        {
            try
            {
                txtReceive.Text = serialPort.ReadExisting() + “\n“;
            }
            catch (Exception E)
            {

                MessageBox.Show(E.Message.ToString() “错误……“ MessageBoxButtons.OK MessageBoxIcon.Hand MessageBoxDefaultButton.Button1);
                return;
            }
        }

        private void btnClose_Click(object sender EventArgs e)
        {
            if (serialPort.IsOpen)
                serialPort.Close();
        }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       7330  2008-07-24 00:35  Bluetooth_Test\frmMain.Designer.cs

     文件       4255  2008-07-24 00:03  Bluetooth_Test\Bluetooth_Test.csproj

     文件       1619  2008-07-24 00:35  Bluetooth_Test\frmMain.cs

     文件       6513  2008-07-24 00:35  Bluetooth_Test\frmMain.resx

     文件        198  2008-07-24 10:58  Bluetooth_Test\Bluetooth_Test.csproj.user

     文件       1082  2008-07-23 23:27  Bluetooth_Test\Bluetooth_Test.sln

    ..A..H.     10240  2008-07-24 10:58  Bluetooth_Test\Bluetooth_Test.suo

     文件        361  2008-07-23 23:27  Bluetooth_Test\Program.cs

     文件     150601  2008-07-23 23:37  Bluetooth_Test\Bluetooth_Test.ico

     文件     282782  2008-07-24 00:03  Bluetooth_Test\ff.ico

     文件       5618  2008-07-23 23:26  Bluetooth_Test\Properties\Resources.resx

     文件       1171  2008-07-23 23:26  Bluetooth_Test\Properties\AssemblyInfo.cs

     文件       2363  2008-07-23 23:26  Bluetooth_Test\Properties\Resources.Designer.cs

     文件     292352  2008-07-24 00:36  Bluetooth_Test\bin\Debug\Bluetooth_Test.exe

     文件      22016  2008-07-24 00:36  Bluetooth_Test\bin\Debug\Bluetooth_Test.pdb

     文件        319  2008-07-24 10:56  Bluetooth_Test\obj\Bluetooth_Test.csproj.FileList.txt

     文件        180  2008-07-24 00:36  Bluetooth_Test\obj\Debug\Bluetooth_Test.frmMain.resources

     文件        180  2008-07-24 00:01  Bluetooth_Test\obj\Debug\Bluetooth_Test.Properties.Resources.resources

     文件      22016  2008-07-24 00:36  Bluetooth_Test\obj\Debug\Bluetooth_Test.pdb

     文件     292352  2008-07-24 00:36  Bluetooth_Test\obj\Debug\Bluetooth_Test.exe

     文件     284304  2008-07-24 10:56  Bluetooth_Test\obj\Debug\win32res.obj

     文件        844  2008-07-24 00:36  Bluetooth_Test\obj\Debug\Bluetooth_Test.csproj.GenerateResource.Cache

     目录          0  2008-07-24 08:52  Bluetooth_Test\obj\Debug\TempPE

     目录          0  2008-07-24 08:52  Bluetooth_Test\obj\Debug\Refactor

     目录          0  2008-07-24 08:52  Bluetooth_Test\bin\Debug

     目录          0  2008-07-24 08:52  Bluetooth_Test\obj\Debug

     目录          0  2008-07-24 08:52  Bluetooth_Test\Properties

     目录          0  2008-07-24 08:52  Bluetooth_Test\bin

     目录          0  2008-07-24 08:52  Bluetooth_Test\obj

     目录          0  2008-07-24 08:52  Bluetooth_Test

............此处省略3个文件信息

评论

共有 条评论

相关资源