• 大小: 0.07M
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2020-12-26
  • 语言: C#
  • 标签: C#  串口  通信  

资源简介

简单的C#串口实例Demo,方便初次开发串口编程朋友使用。

资源截图

代码片段和文件信息

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

namespace SerialPortConnection
{
    public partial class Form1 : Form
    {
        SerialPort sp1 = new SerialPort();
        //sp1.ReceivedBytesThreshold = 1;//只要有1个字符送达端口时便触发DataReceived事件 
         
        public Form1()
        {
            InitializeComponent();
        }

        //加载
        private void Form1_Load(object sender EventArgs e)
        {
            INIFILE.Profile.LoadProfile();//加载所有
            
           // 预置波特率
            switch (Profile.G_BAUDRATE)
            {
     

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

     文件       5612  2012-08-06 14:57  SerialPortConnection\SerialPortConnection\Properties\Resources.resx

     文件        249  2012-08-06 14:57  SerialPortConnection\SerialPortConnection\Properties\Settings.settings

     文件       1476  2012-08-06 14:57  SerialPortConnection\SerialPortConnection\Properties\AssemblyInfo.cs

     文件       2869  2012-08-06 14:57  SerialPortConnection\SerialPortConnection\Properties\Resources.Designer.cs

     文件       1105  2012-08-06 14:57  SerialPortConnection\SerialPortConnection\Properties\Settings.Designer.cs

     文件      26561  2012-08-15 14:13  SerialPortConnection\SerialPortConnection\Form1.Designer.cs

     文件       1468  2012-08-14 11:37  SerialPortConnection\SerialPortConnection\Profile.cs

     文件       3862  2012-08-09 10:13  SerialPortConnection\SerialPortConnection\SerialPortConnection.csproj

     文件        490  2007-07-21 01:33  SerialPortConnection\SerialPortConnection\bin\Debug\SerialPortConnection.vshost.exe.manifest

     文件      14328  2012-08-16 20:49  SerialPortConnection\SerialPortConnection\bin\Debug\SerialPortConnection.vshost.exe

     文件      26112  2012-08-15 17:18  SerialPortConnection\SerialPortConnection\bin\Debug\SerialPortConnection.exe

     文件      44544  2012-08-15 17:18  SerialPortConnection\SerialPortConnection\bin\Debug\SerialPortConnection.pdb

     文件         66  2012-09-08 09:54  SerialPortConnection\SerialPortConnection\bin\Debug\Cfg.ini

     文件        180  2012-08-15 14:13  SerialPortConnection\SerialPortConnection\obj\Debug\SerialPortConnection.Form1.resources

     文件        180  2012-08-09 10:13  SerialPortConnection\SerialPortConnection\obj\Debug\SerialPortConnection.Properties.Resources.resources

     文件        847  2012-08-15 14:13  SerialPortConnection\SerialPortConnection\obj\Debug\SerialPortConnection.csproj.GenerateResource.Cache

     文件       1047  2012-08-16 20:49  SerialPortConnection\SerialPortConnection\obj\Debug\SerialPortConnection.csproj.FileListAbsolute.txt

     文件      44544  2012-08-15 17:18  SerialPortConnection\SerialPortConnection\obj\Debug\SerialPortConnection.pdb

     文件      26112  2012-08-15 17:18  SerialPortConnection\SerialPortConnection\obj\Debug\SerialPortConnection.exe

     文件      20297  2012-08-15 17:18  SerialPortConnection\SerialPortConnection\Form1.cs

     文件       6582  2012-08-15 14:13  SerialPortConnection\SerialPortConnection\Form1.resx

     文件       7503  2012-08-09 10:13  SerialPortConnection\SerialPortConnection\IniFile.cs

     文件        512  2012-08-06 14:57  SerialPortConnection\SerialPortConnection\Program.cs

     文件        950  2012-08-06 14:57  SerialPortConnection\SerialPortConnection.sln

    ..A..H.     27648  2012-08-16 20:49  SerialPortConnection\SerialPortConnection.suo

     目录          0  2012-08-06 14:57  SerialPortConnection\SerialPortConnection\obj\Debug\TempPE

     目录          0  2012-08-06 15:00  SerialPortConnection\SerialPortConnection\obj\Debug\Refactor

     目录          0  2012-08-06 14:57  SerialPortConnection\SerialPortConnection\bin\Debug

     目录          0  2012-08-06 14:57  SerialPortConnection\SerialPortConnection\obj\Debug

     目录          0  2012-08-06 14:57  SerialPortConnection\SerialPortConnection\Properties

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

评论

共有 条评论