自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

段江涛

专注于IT信息交流

  • 博客(1)
  • 资源 (5)
  • 收藏
  • 关注

原创 asp.net一般处理程序利用反射定位方法

using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Threading; using System.Web; namespace MyWeb { /// /// GetMsg 的摘要说明 /// publ

2016-04-12 15:14:52 343 1

C#MD5加密.zip

C#的加密方式有很多种,这里给出了一个最简单的方式,我们在数据库密码中经常使用到,另外下载后可以直接运行的。

2019-06-30

dom4j-1.6.1.jar

java解析xml的jar包,很好用的哟

2017-05-10

C#获取机器码

通过C#获取机器唯一标识,然后自己通过加密手段加密生成注册码,可通过注册码验证程序能否正确运行。

2015-04-21

C#串口实例 源代码

namespace 串口实例 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void btnSend_Click(object sender, EventArgs e) { //手动发送 SendMsg(); } private void SendMsg() { this.serialPort1.Write(this.txtSend.Text); } #region 控制输入数字 private void ComboBox_TextUpdate(object sender, EventArgs e) { ComboBox cbo = sender as ComboBox; int n; if (!int.TryParse(cbo.Text, out n)) { cbo.Text = cbo.Text.Substring(0, cbo.Text.Length - 1); } else { if (n <= 0) { cbo.Text = cbo.Text.Substring(0, cbo.Text.Length - 1); } } } private void txtTime_TextChanged(object sender, EventArgs e) { TextBox text = sender as TextBox; int n; if (!int.TryParse(text.Text, out n)) { text.Text = text.Text.Substring(0, text.Text.Length - 1); } else { if (n <= 0) { text.Text = text.Text.Substring(0, text.Text.Length - 1); } else { this.timer1.Interval = n; } } } #endregion /// <summary> /// 清空显示文本框 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnClear_Click(object sender, EventArgs e) { this.txtRecive.Clear(); } private void timer1_Tick(object sender, EventArgs e) { SendMsg(); } private void cbtSend_CheckedChanged(object sender, EventArgs e) { CheckBox check = sender as CheckBox; if (check.Checked) { this.timer1.Start(); } else { this.timer1.Stop(); } } /// <summary> /// 接收返回的数据 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void serialPort1_DataReceived(object sender, System.IO.Ports.SerialDataReceivedEventArgs e) { string a=""; if (this.cbkShow16.Checked) { //十六进制显示 a = this.serialPort1.ReadExisting(); } else { //字符串显示 byte[] by = new byte[this.serialPort1.BytesToRead]; this.serialPort1.Read(by, 0, this.serialPort1.BytesToRead); a = Encoding.ASCII.GetString(by); } this.txtRecive.AppendText(a); this.txtRecive.ScrollToCaret(); } private void Form1_Load(object sender, EventArgs e) { //加载 this.serialPort1.RtsEnable = true; button1_Click(this.btnOpen, null); } private void button1_Click(object sender, EventArgs e) { Button btn = sender as Button; if (btn.Text == "打开端口") { try { this.serialPort1.PortName = this.cboPortName.Text; this.serialPort1.BaudRate = Convert.ToInt32(this.cboRaudRate.Text); this.serialPort1.DataBits = Convert.ToInt32(this.cboDataBits.Text); this.serialPort1.ReceivedBytesThreshold = Convert.ToInt32(this.cboReceivedBytesThreshold.Text); this.serialPort1.Open(); btn.Text = "关闭端口"; } catch { MessageBox.Show("打开端口失败,请检查端口是否被占用."); } } else { this.serialPort1.Close(); btn.Text = "打开端口"; } } private void Form1_FormClosing(object sender, FormClosingEventArgs e) { try { this.serialPort1.Close(); } catch { } } } }

2015-04-19

312个网页常用小图标

常用的网页常用小图标,常用的图标收藏,以后再也不用担心找不到图标了

2015-04-18

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除