资源简介
通过C#实现串口通信,里面的代码展示了如何监听计算机中的串口,解析数据或者发送数据,做串口开发的可以参考
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using System.Reflection;
namespace PCComm
{
partial class AboutBox : Form
{
public AboutBox()
{
InitializeComponent();
// Initialize the AboutBox to display the product information from the assembly information.
// Change assembly information settings for your application through either:
// - Project->Properties->Application->Assembly Information
// - AssemblyInfo.cs
this.Text = String.Format(“About {0}“ Assemblytitle);
this.labelProductName.Text = AssemblyProduct;
this.labelVersion.Text = String.Format(“Version {0}“ AssemblyVersion);
this.labelCopyright.Text = AssemblyCopyright;
this.labelCompanyName.Text = AssemblyCompany;
this.textBoxDescription.Text = AssemblyDescription;
}
#region Assembly Attribute Accessors
public string Assemblytitle
{
get
{
// Get all title attributes on this assembly
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblytitleAttribute) false);
// If there is at least one title attribute
if (attributes.Length > 0)
{
// Select the first one
AssemblytitleAttribute titleAttribute = (AssemblytitleAttribute)attributes[0];
// If it is not an empty string return it
if (titleAttribute.title != ““)
return titleAttribute.title;
}
// If there was no title attribute or if the title attribute was the empty string return the .exe name
return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().Codebase);
}
}
public string AssemblyVersion
{
get
{
return Assembly.GetExecutingAssembly().GetName().Version.ToString();
}
}
public string AssemblyDescription
{
get
{
// Get all Description attributes on this assembly
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute) false);
// If there aren‘t any Description attributes return an empty string
if (attributes.Length == 0)
return ““;
// If there is a Description attribute return its value
return ((AssemblyDescriptionAttribute)attributes[0]).Description;
}
}
public string AssemblyProduct
{
get
{
// Get all P
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 4884 2011-11-28 01:28 SerialPort-master\SerialPort-master\Backup\SerialPortCommunication\AboutBox.cs
文件 10533 2011-11-28 01:28 SerialPort-master\SerialPort-master\Backup\SerialPortCommunication\AboutBox.Designer.cs
文件 49720 2011-11-28 01:28 SerialPort-master\SerialPort-master\Backup\SerialPortCommunication\AboutBox.resx
文件 1276 2011-11-28 01:28 SerialPort-master\SerialPort-master\Backup\SerialPortCommunication\app.config
文件 13851 2011-11-28 01:28 SerialPort-master\SerialPort-master\Backup\SerialPortCommunication\CommunicationManager.cs
文件 3967 2011-11-28 01:28 SerialPort-master\SerialPort-master\Backup\SerialPortCommunication\frmMain.cs
文件 31481 2011-11-28 01:28 SerialPort-master\SerialPort-master\Backup\SerialPortCommunication\frmMain.Designer.cs
文件 15028 2011-11-28 01:28 SerialPort-master\SerialPort-master\Backup\SerialPortCommunication\frmMain.resx
文件 475 2011-11-28 01:28 SerialPort-master\SerialPort-master\Backup\SerialPortCommunication\Program.cs
文件 1352 2011-11-28 01:28 SerialPort-master\SerialPort-master\Backup\SerialPortCommunication\Properties\AssemblyInfo.cs
文件 3086 2011-11-28 01:28 SerialPort-master\SerialPort-master\Backup\SerialPortCommunication\Properties\Resources.Designer.cs
文件 6197 2011-11-28 01:28 SerialPort-master\SerialPort-master\Backup\SerialPortCommunication\Properties\Resources.resx
文件 3309 2011-11-28 01:28 SerialPort-master\SerialPort-master\Backup\SerialPortCommunication\Properties\Settings.Designer.cs
文件 927 2011-11-28 01:28 SerialPort-master\SerialPort-master\Backup\SerialPortCommunication\Properties\Settings.settings
文件 3774 2011-11-28 01:28 SerialPort-master\SerialPort-master\Backup\SerialPortCommunication\Resources\serial.ico
文件 3899 2011-11-28 01:28 SerialPort-master\SerialPort-master\Backup\SerialPortCommunication\SerialPortCommunication.csproj
文件 1255 2011-11-28 01:28 SerialPort-master\SerialPort-master\Backup\SerialPortCommunication\Settings.cs
文件 958 2011-11-28 01:28 SerialPort-master\SerialPort-master\Backup\SerialPortCommunication.sln
..A..H. 17408 2011-11-28 01:28 SerialPort-master\SerialPort-master\Backup\SerialPortCommunication.suo
....... 50 2011-11-28 01:28 SerialPort-master\SerialPort-master\README
....... 4884 2011-11-28 01:28 SerialPort-master\SerialPort-master\SerialPortCommunication\AboutBox.cs
....... 10533 2011-11-28 01:28 SerialPort-master\SerialPort-master\SerialPortCommunication\AboutBox.Designer.cs
....... 49720 2011-11-28 01:28 SerialPort-master\SerialPort-master\SerialPortCommunication\AboutBox.resx
....... 1276 2011-11-28 01:28 SerialPort-master\SerialPort-master\SerialPortCommunication\app.config
文件 1276 2011-11-28 01:28 SerialPort-master\SerialPort-master\SerialPortCommunication\bin\Release\SerialPortCommunication.exe.config
文件 11608 2015-03-30 15:03 SerialPort-master\SerialPort-master\SerialPortCommunication\bin\Release\SerialPortCommunication.vshost.exe
文件 1276 2011-11-28 01:28 SerialPort-master\SerialPort-master\SerialPortCommunication\bin\Release\SerialPortCommunication.vshost.exe.config
文件 490 2010-03-17 22:39 SerialPort-master\SerialPort-master\SerialPortCommunication\bin\Release\SerialPortCommunication.vshost.exe.manifest
....... 13851 2011-11-28 01:28 SerialPort-master\SerialPort-master\SerialPortCommunication\CommunicationManager.cs
....... 3967 2011-11-28 01:28 SerialPort-master\SerialPort-master\SerialPortCommunication\frmMain.cs
............此处省略42个文件信息
- 上一篇:多线程采集网页C#源代码
- 下一篇:C# 串口调试助手源代码
相关资源
- C# 调用win32 api函数-user32.dll详细说明
- C# 调用BarTender打印条码DEMO
- 大型比赛竞赛抽签系统 可打印 c# vs
- C#编写的Gerber查看器
- lua C# .Net4.0 vs2010 LuaInterface
- C#十六进制编辑器
- 明华URF-35H读卡器 C#读写源码 为大家
- C#文件流读取CSV文件
- c#读写PDF文件sql
- C# winform Socket大文件传输
- c#车牌识别系统附30张测试图片
- 《C#面向对象程序设计》源代码(CS)
- 金旭亮《C#面向对象程序设计》教案
- 试题库管理系统毕业论文(C#)源程序
- 学校网站原代码(C#.NET)
- C#-数据库操作技术-员工管理系统
- c#web开发入门经典
- C#与Matlab混合编程的几种方式
- c# 开发与 mysql数据库实现的增删改查
- C#异步操作 异步查询数据库 异步处理
- Basler相机通过IO触发源码
- [源代码] 《领域驱动设计 (C# 2008 实
- 松下PLC与C#通讯串口调试入门教程.z
- USB 继电器控制器 LCUS-1 保证能用 c#
- C# AES加密解密小工具
- C#圆形按钮,非常漂亮动态~~
- [精]C#仿QQ右下角弹出提示框()
- C#进程间通信-共享内存代码
- 有史以来最简单的三层(C#)
- vb调用c#编写的串口DLL文件(vb源码
评论
共有 条评论