-
Zigbee智能家居完整的源代码
Zigbee智能家居完整的源代码,含有终端和协调器工程并带有汉语注释。非常适合Zigbee开发。-Zigbee Smart Home complete source code, containing the terminal and the coordinator works with Chinese comments. Very suitable for the Zigbee development.
- 2022-03-05 18:50:08下载
- 积分:1
-
C# 指定主机和端口发消息的实现
Visual C# 指定主机和端口发消息的实现例子,支持和远程主机发送消息,本例子可学习到很多实用的网络方法的用法,以下代码是本功能的核心实现:
richTextBox1.Text = string.Empty;
//实例化UdpClient对象
UdpClient udpclient = new UdpClient(Convert.ToInt32(textBox2.Text));
//调用UdpClient对象的Connect建立默认远程主机
udpclient.Connect(textBox1.Text, Convert.ToInt32(textBox2.Text));
//定义一个字节数组,用来存放发送到远程主机的信息
Byte[] sendBytes = Encoding.Default.GetBytes(textBox3.Text);
//调用UdpClient对象的Send方法将Udp数据报发送到远程主机
udpclient.Send(sendBytes, sendBytes.Length);
//实例化IPEndPoint对象,用来显示响应主机的标识
IPEndPoint ipendpoint = new IPEndPoint(IPAddress.Any, 0);
//调用UdpClient对象的Receive方法获得从远程主机返回的Udp数据报
Byte[] receiveBytes = udpclient.Receive(ref ipendpoint);
//将获得的Udp数据报转换为字符串形式
string returnData = Encoding.Default.GetString(receiveBytes);
richTextBox1.Text = "接收到的信息:" + returnData.ToString();
//使用IPEndPoint对象的Address和Port属性获得响应主机的IP地址和端口号
richTextBox1.Text += "
这条信息来自主机" + ipendpoint.Address.ToString()
+ "上的" + ipendpoint.Port.ToString() + "端口";
//关闭UdpClient连接
- 2022-02-10 10:21:19下载
- 积分:1
-
C# WPF 使用图像控件显示绘制的文本字符串
C# WPF 使用图像控件显示绘制的文本字符串,这里将文字绘制成渐变色样式,十分漂亮,颜色值和字体样式可在实例源码目录的Window1.xaml.cs文件中修改,代码如下:
用图像控件显示绘制的文本字符串
RadialGradientBrush MyRadialGradientBrush = new RadialGradientBrush();
//对颜色的定义
MyRadialGradientBrush.GradientOrigin = new Point(0.5, 0.5);
MyRadialGradientBrush.Center = new Point(0.5, 0.5);
MyRadialGradientBrush.RadiusX = 0.5;
MyRadialGradientBrush.RadiusY = 0.5;
MyRadialGradientBrush.GradientStops.Add(new GradientStop(Colors.Yellow, 0.0));
MyRadialGradientBrush.GradientStops.Add(new GradientStop(Colors.Red, 0.25));
MyRadialGradientBrush.GradientStops.Add(new GradientStop(Colors.Blue, 0.75));
MyRadialGradientBrush.GradientStops.Add(new GradientStop(Colors.LimeGreen, 1.0));
MyRadialGradientBrush.Freeze();
FontStyle MyStyle = FontStyles.Normal;
FontWeight MyWeight = FontWeights.Medium;
MyWeight = FontWeights.Bold;
MyStyle = FontStyles.Italic;
//要显示字体的定义
string MyText = "开源爱好者";
var MyFont = new FontFamily("宋体");、、字体样式的定义,默认为宋体
FormattedText MyFo
- 2023-04-06 04:45:04下载
- 积分:1
-
C# 输入界面中的各种文本框判断效果演示
这是一个实用的输入判断验证演示程序,面向C#编程环境,当用户输入的数据不正确或为空时,均会显示提示,不过这个提示是一个图标在闪烁,直到输入正确,下面是判断机制:
private void textBox2_Validating(object sender, System.ComponentModel.CancelEventArgs e)
{
if (textBox2.Text == "")//判断是否输入订货数量
{
errorProvider2.SetError(textBox2, "不能为空");//设置errorProvider2的错误提示
}
else
{
try
{
int x = Int32.Parse(textBox2.Text);//判断是否输入数字,如果不是数字会出现异常
errorProvider2.SetError(textBox2, "");// errorProvider2控件不显示任何错误信息
b = 1;//将b赋值为1
}
catch
{
//如果出现异常,设置errorProvider2控件的错误信息
errorProvider2.SetError(textBox2, "请输入一个数");
}
}
}
private void textBox3_Validating(object sender, System.ComponentModel.CancelEventArgs e)
{
if (textBox3.Text == "")//判断是否输入订货数量
{
errorProvider3.SetError(textBox3, "不能为空");//设置errorProvider3显示的错误消息
}
else
{
errorProvider3.SetError(textBox
- 2022-01-25 17:43:07下载
- 积分:1
-
C# 读取MP3歌曲文件标志信息并使用Quartz库播放
C# 读取MP3歌曲文件标志信息并使用Quartz库播放、读取WAV歌曲文件标志信息、使用Quartz库播放MP3歌曲、使用Quartz库播放DVD视频、弹出光驱、关闭光驱等功能,获取的MP3文件信息包括歌名、艺术家、签名册、发行日期等。同时还可以读取WAV歌曲文件标志信息,具体的标记信息请下载本源码查看Form1.cs文件。本实例部分功能需要依赖Interop.QuartzTypeLib.dll组件来实现。
- 2023-05-14 15:55:02下载
- 积分:1
-
C# LINQ操作相关函数集代码
C# LINQ操作相关函数集代码,这个函数集成在一个C#的实例程序中,包括了以下常用的LINQ操作函数,比如:获取LINQ返回序列的第一个元素、获取LINQ返回序列的最后一个元素、获取LINQ返回序列指定位置的元素、获取LINQ返回序列的单个特定元素、获取LINQ返回序列的非重复元素、将两个序列的元素合并为一个序列、获取序列中符合条件的元素个数、合并元素索引将元素投影到新表、将元素子级过滤结果投影到新表等。
- 2022-08-18 19:41:06下载
- 积分:1
-
7Zip
This file is part of SevenZipSharp. SevenZipSharp is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. SevenZipSharp is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with SevenZipSharp. If not, see .
- 2022-07-20 00:09:31下载
- 积分:1
-
C++ 6.0 画线源码有文档说明
文件采用C++6.0基于MFC制作具有Breseam算法和中点画线算法,简单明了适用于初学者,还有文档说明使读者一看就懂,运行后只需选择相应算法以及输入相应颜色的值及起始点就可以画出任意方向任意颜色的直线
- 2022-02-02 10:20:41下载
- 积分:1
-
C语言实现socks5协议
C语言实现socks5协议,亲测有效。可以简单测试客户端与服务器之间的通信,支持在linux机器上运行,提供源码。
- 2022-07-19 01:01:48下载
- 积分:1
-
C# 递增运算/递减运算
C# 简单模拟递增运算、递减运算:
private void repeatButton1_Click(object sender, RoutedEventArgs e)
{//递增运算
Int32 MyNum = Convert.ToInt32(this.textBox1.Text);
this.label1.Content = "正在进行递增运算:";
this.textBox1.Text = ((MyNum + 1).ToString());
}
private void repeatButton2_Click(object sender, RoutedEventArgs e)
{//递减运算
Int32 MyNum = Convert.ToInt32(this.textBox1.Text);
this.label1.Content = "正在进行递减运算:";
this.textBox1.Text = ((MyNum - 1).ToString());
}
- 2022-02-26 15:45:23下载
- 积分:1