-
C# winform 运行时拖动可改变控件大小及位置
C# winform 运行时拖动可改变控件大小及位置,在代码中定义了PickBox类,这个类实现了窗体控件的 大小和移动函数,用户运行时编辑,完成将pick box 附加到 相应的控件上,添加用于将选定控件移动的事件处理程序,移除上一个控件的事件处理,将大小调整手柄添加到控件容器中,位置控制周围的大小调整。。。
- 2022-02-05 07:11:00下载
- 积分:1
-
104规约IEC60870-5-104
完整的能通过vs2010运行的IEC-104主站和辅站源代码,本人在公司实习亲自编写的。对初学者帮助很大而且对104协议的剖析很清楚。
- 2023-05-22 09:00:20下载
- 积分:1
-
C# winform邮件发送 可抄送、密送、发附件
C# 可抄送、密送、发附件的Winform发邮件程序,邮件主是信息的填写部分要注意格式不能错,抄送和密送时多个收件人以分号隔开,可连续发送多个附件,多个附件以分号隔开。发送邮件采用了发送邮件函数的方式,方便以模块化调用 ,发邮件还可异步发送,SMTP 服务器要求安全连接需要设置smtp.EnableSsl = Ssl属性。
请注意:发送邮件前,请先配置然后再发邮件(注:以上参数为格式示例,需自行更改为实际真实有效的信息)。
发邮件的整体用户界面如测试图所示。
- 2023-08-13 11:10:02下载
- 积分:1
-
C# 修复Access数据库的一个范例程序
C# 修复Access数据库的一个范例程序,不过不知道到底能不能修复吧,这个修复过程的编写,可参考以下代码:
//声明临时数据库的名称
string temp = DateTime.Now.Year.ToString();
temp += DateTime.Now.Month.ToString();
temp += DateTime.Now.Day.ToString();
temp += DateTime.Now.Hour.ToString();
temp += DateTime.Now.Minute.ToString();
temp += DateTime.Now.Second.ToString() + ".bak";
temp = strPathMdb.Substring(0, strPathMdb.LastIndexOf("") + 1) + temp;
//定义临时数据库的连接字符串
string temp2 = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + temp;
//定义目标数据库的连接字符串
string strPathMdb2 = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + strPathMdb;
JRO.JetEngineClass jt = new JRO.JetEngineClass();//创建一个JetEngineClass对象
//使用JetEngineClass对象的CompactDatabase方法压缩修复数据库
jt.CompactDatabase(strPathMdb2, temp2);
File.Copy(temp, strPathMdb, true);//拷贝临时数据库到目标数据库(覆盖)
File.Delete(temp);//删除临时数据库
MessageBox.Show("修复完成");
这个程序中使用了三个类库:Interop.ADODB.dll、Interop.ADOX.dll、Interop.JRO.dll。
- 2022-01-26 03:31:51下载
- 积分: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# GroupBy将字符串数组按元素长度分组
C#演示 GroupBy字符串操作范例,C# GroupBy将字符串数组按元素长度分组:
string[] Words = new string[] { "what", "is", "your", "name", "?", "my", "name", "is", "lyf", "." };
var Groups = from word in Words
group word by word.Length into lengthGroups//按单词长度将单词分组
orderby lengthGroups.Key descending//按单词长度降序排列
select new
{
Length = lengthGroups.Key,//取单词长度
WordCollect = lengthGroups//取该长度的单词分组集合
};最后使用foreach循环遍历每组单词,将罗列出包括指定字符的单词是哪几个。
- 2023-08-16 01:45:03下载
- 积分:1
-
C# 使用定时器动画摆动显示图形
C# 使用定时器动画摆动显示图形,利用定时器可改变物体运动的振幅、角频率、初相,初始化图形数据,生成如演示效果所示的,圆形小球来回摆动的动画效果。你可以通过窗口中的两个按钮,来查看效果:启动有窗体定时器、关闭有窗体定时器。初始化图形数据的代码如下:
this.timer1.Interval = 30;
r1.X = System.Convert.ToInt16(this.panel1.Width / 2 - 30);
r1.Y = System.Convert.ToInt16(this.panel1.Height / 2 - 30);
r1.Width = 60;
r1.Height = 60;
r2 = r1;
x = System.Convert.ToInt16(this.panel1.Width / 2);
- 2022-03-03 11:34:28下载
- 积分:1
-
C# 图像控件显示绘制的几何图形
C# 使用图像控件显示绘制的多个几何图形,可一次显示多个绘制的图形,相关代码如下:
GeometryGroup MyGeometry = new GeometryGroup();
MyGeometry.Children.Add(new EllipseGeometry(new Point(50, 50), 45, 20));
MyGeometry.Children.Add(new EllipseGeometry(new Point(50, 50), 20, 45));
RectangleGeometry MyRectangle = new RectangleGeometry();
MyRectangle.Rect = new Rect(2, 2, 96, 96);
MyGeometry.Children.Add(MyRectangle);
GeometryDrawing MyDrawing = new GeometryDrawing();
MyDrawing.Geometry = MyGeometry;
MyDrawing.Pen = new Pen(Brushes.Blue, 3);
DrawingImage MyImage = new DrawingImage();
MyImage.Drawing = MyDrawing;
MyImage.Freeze();
this.image1.Source = MyImage;
- 2022-03-07 01:28:50下载
- 积分:1
-
像打字游戏的C#打字练习软件
像打字游戏的C#打字练习软件,名字叫做“梦雨打字通”。指法练习,出现的字符,在倒计时3秒内会自动消失,若你没有按下键盘上对应的键,则就算打字失败了,这个可以测试你的打字速度,所说里面的大部分分功能借鉴了金山打字通的一些模式。
本软件在编写时,用到了工厂类、随机生产LetterClass、计时器类,每一个Letter在屏幕上的停留时间计时,keyDown事件类,设置 字符总数 正确总数 正确率,X方向的Tick事件等。
- 2022-08-04 11:03:56下载
- 积分:1
-
C# 把listView数据排列成图标缩略图风格
C#控制ListView的显示方式,把listView数据排列成图标缩略图风格,这种风格在Windows中十常见,图标的排列就是这种风格的,实现的相关代码:
private void Form1_Load(object sender, EventArgs e)
{
listView1.Items.Add("开源爱好者");//使用Add方法向控件中添加项目
listView1.Items.Add("www.codesc.net");//使用Add方法向控件中添加项目
listView1.Items.Add("C#从基础到项目实战");//使用Add方法向控件中添加项目
listView1.Items[2].Selected = true;//使用Selected方法选中第3项
}
- 2023-06-24 02:00:03下载
- 积分:1