-
半条命II游戏源代码
半条命II游戏源代码,这是完整的企业级游戏源码,采用vc6编写。是开发大型游戏的必备参考,非常有价值。
- 2022-03-23 19:15:28下载
- 积分:1
-
C# 启动外部计算器计算数据
C# 启动外部计算器计算数据,private void button1_Click(object sender, EventArgs e)
{//启动计算器计算数据(从当前程序向其他程序发送键击数据)
ProcessStartInfo MyStartInfo = new ProcessStartInfo();
MyStartInfo.FileName = "Calc.exe";
Process MyProcess = new Process();
MyProcess.StartInfo = MyStartInfo;
MyProcess.Start();
System.Threading.Thread.Sleep(100);
IntPtr MyHandle = FindWindow("SciCalc", "计算器");
if (MyHandle == IntPtr.Zero)
{
MessageBox.Show("计算器程序没有运行","信息提示",MessageBoxButtons.OK);
return;
}
SetForegroundWindow(MyHandle);
SendKeys.SendWait("88");
SendKeys.SendWait("*");
SendKeys.SendWait("8");
SendKeys.SendWait("=");
}
- 2023-04-17 08:10:03下载
- 积分:1
-
C#邮件收发程序 发Email和接收邮件
C#实现的一个邮件收发程序,功能主要是两大块,发送邮件和接收邮件,类似于一个邮件客户端的功能,在这个邮件发送程序中,写了几个函数分别实现相关的模块功能:
对获得连接的用户身份进行验证
获取登录邮箱的各种信息
判断返回的字符串信息,如果是“+OK”,证明登录成功,否则登录失败
根据输入的邮件编号读取邮件信息
获取由参数标识的邮件的全部文本
对读取的邮件内容进行Base64编码
“登录”按钮事件,实例化SmtpClient邮件发送类对象
初始化StreamReader对象,以便以流的形式读取远程主机中的内容
获取远程主机中指定用户的邮件信息
获得远程主机上指定邮件的相关信息,存储到一个string类型的数组中,数组中的内容包括:邮件日期、发信人、收信人、邮件主题、邮件内容等。
- 2022-04-23 02:56:49下载
- 积分:1
-
C# DataGridView初级操作范例
这是一个C# DataGridView初级操作范例,演示了连接数据库、读取数据库、移动数据库指针到下一条、上一条记录的操作,以及将数据绑定到DataGridView控件中显示的整个过程,比较基础级的C#源码,因此希望新手参考:
private void shippersDataGridView_DataError(object sender, DataGridViewDataErrorEventArgs e)
{//如果错误发生在提交操作过程中,则在 MessageBox 中显示该错误
if (e.Exception != null && e.Context == DataGridViewDataErrorContexts.Commit)
{//测试时在Phone列中输入一个超长的字符串
MessageBox.Show(e.Exception.Message, "信息提示", MessageBoxButtons.OK);
}
}
- 2022-01-22 02:28:43下载
- 积分:1
-
C# 数据分组统计(单列)
C# 数据分组统计(单列),这个测试需要连接SQLSERVER才可以,运行效果如上图所示,请下载源码包查看详细代码情况。
- 2023-08-05 06:35:03下载
- 积分:1
-
C# WPF把彩色图片转换为灰度图
C# 把彩色图片转换为灰度图,这是一个基于WPF的C#图像处理程序,图像彩色转换黑白,支持的图像文件格式为:JPeg,Gif,Bmp,etc。
程序主要实现两个功能,一是将彩色转换为索引像素格式、二是将彩色转换为黑白像素格式,对应于窗口中的按钮,可查看对应功能的演示:
将彩色转换为黑白像素格式,核心代码如下:
TransformedBitmap MyRotatedBitmapSource = new TransformedBitmap();
MyRotatedBitmapSource.BeginInit();
MyRotatedBitmapSource.Source = (System.Windows.Media.Imaging.BitmapSource)this.image1.Source;
MyRotatedBitmapSource.Transform = new RotateTransform(270);
MyRotatedBitmapSource.EndInit();
FormatConvertedBitmap MyFormatedBitmap = new FormatConvertedBitmap();
MyFormatedBitmap.BeginInit();
MyFormatedBitmap.Source = MyRotatedBitmapSource;
MyFormatedBitmap.DestinationFormat = PixelFormats.BlackWhite;
MyFormatedBitmap.EndInit();
this.image1.Source = MyFormatedBitmap;
完整源码例子请在本页下载,运行效果截图如下图示。
- 2022-02-01 21:42:57下载
- 积分: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# 利用AND运算符进行查询
C# 利用AND运算符进行查询,查询外语成绩和高数成绩都大于80的学生信息。相关的SQL语句写法和自定义如下:
string P_Str_ConnectionStr = string.Format(//创建数据库连接字符串
@"server=WIN-GI7E47AND9RLS;database=db_TomeTwo;uid=sa;pwd=");
string P_Str_SqlStr = string.Format(//创建SQL查询字符串
"SELECT * FROM tb_Grade WHERE 外语>80 AND 高数>80");
SqlDataAdapter P_SqlDataAdapter = new SqlDataAdapter(//创建数据适配器
P_Str_SqlStr, P_Str_ConnectionStr);
DataTable P_dt = new DataTable();//创建数据表
P_SqlDataAdapter.Fill(P_dt);//填充数据表
return P_dt;//返回数据表
- 2023-08-29 10:55:04下载
- 积分:1
-
Visual C# 读取音频文件并复制到剪贴板
粘贴剪贴板音频数据并播放,Visual C# 读取音频文件并复制到剪贴板,此外还提供了清空剪贴板上音频数据的功能。下面我们分别来看这几个重点功能具体是如何实现的,代码如下:
private void Button1_Click(object sender, EventArgs e)
{//读取音频文件并复制到剪贴板
Byte[] MyData=System.IO.File.ReadAllBytes("WindowsXP.wav");
Clipboard.SetAudio(MyData);
}
private void Button2_Click(object sender, EventArgs e)
{//粘贴剪贴板音频数据并播放
object MyData =Clipboard.GetData(DataFormats.WaveAudio);
System.Media.SoundPlayer MyPlayer=new System.Media.SoundPlayer();
MyPlayer.Stream = (System.IO.Stream)MyData;
MyPlayer.Play();
}
private void Button3_Click(object sender, EventArgs e)
{//清空剪贴板上的音频数据
Clipboard.Clear();
}
需要完整的可编译源代码项目,请下载本源码。
- 2022-01-25 17:41:37下载
- 积分:1
-
C++ 6.0 画线源码有文档说明
文件采用C++6.0基于MFC制作具有Breseam算法和中点画线算法,简单明了适用于初学者,还有文档说明使读者一看就懂,运行后只需选择相应算法以及输入相应颜色的值及起始点就可以画出任意方向任意颜色的直线
- 2022-02-02 10:20:41下载
- 积分:1