资源简介
VS2010写的桌面倒计时器,可以设置时间,提醒时间,到时播放的声音,提醒播放的声音,可用于各种竞赛,抢答,演讲的倒计时。

代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Speech.Synthesis;
namespace Counter
{
public partial class Form1 : Form
{
int total_seconds = 100;
int alert_seconds = 0;
// 声明INI文件的写操作函数 WritePrivateProfileString()
[System.Runtime.InteropServices.DllImport(“kernel32“)]
private static extern long WritePrivateProfileString(string section string key string val string filePath);
// 声明INI文件的读操作函数 GetPrivateProfileString()
[System.Runtime.InteropServices.DllImport(“kernel32“)]
private static extern int GetPrivateProfileString(string section string key string def System.Text.StringBuilder retVal int size string filePath);
public void Writue(string section string key string valuestring sPath)
{
// section=配置节,key=键名,value=键值,path=路径
WritePrivateProfileString(section key value sPath);
}
public string ReadValue(string section string keystring sPath)
{
// 每次从ini中读取多少字节
System.Text.StringBuilder temp = new System.Text.StringBuilder(255);
// section=配置节,key=键名,temp=上面,path=路径
GetPrivateProfileString(section key ““ temp 255 sPath);
return temp.ToString();
}
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender EventArgs e)
{
if (string.IsNullOrEmpty(this.label10.Text) || string.IsNullOrEmpty(this.label11.Text))
{
MessageBox.Show(“请先选择播放的提示音!“);
return;
}
if (this.button1.Text == “开始“)
{
int tmp_total_seconds = (int)(this.numericUpDown1.Value) * 60 + (int)(this.numericUpDown2.Value);
int tmp_alert_seconds = (int)(this.numericUpDown4.Value) * 60 + (int)(this.numericUpDown3.Value);
if (tmp_total_seconds < tmp_alert_seconds)
{
MessageBox.Show(“警告时间应该小于总倒计时时间!“);
return;
}
total_seconds = tmp_total_seconds;
alert_seconds=tmp_alert_seconds;
this.timer1.Enabled = true;
this.timer1.Start();
this.button1.Text = “暂停“;
}
else if (this.button1.Text == “暂停“)
{
this.timer1.Stop();
this.timer1.Enabled = false;
this.button1.Text = “继续“;
}
else if (this.button1.Text == “继续“)
{
this.timer1.Enabled = true;
this.timer1.Start();
this.button1.Text = “暂停“;
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 117 2016-11-22 21:24 Counter\Counter\app.config
文件 337920 2016-11-24 22:55 Counter\Counter\bin\Debug\Counter.exe
文件 117 2016-11-22 21:24 Counter\Counter\bin\Debug\Counter.exe.config
文件 34304 2016-11-24 22:55 Counter\Counter\bin\Debug\Counter.pdb
文件 11608 2016-11-24 22:18 Counter\Counter\bin\Debug\Counter.vshost.exe
文件 117 2016-11-22 21:24 Counter\Counter\bin\Debug\Counter.vshost.exe.config
文件 490 2010-03-18 12:39 Counter\Counter\bin\Debug\Counter.vshost.exe.manifest
文件 60044 2016-11-22 20:39 Counter\Counter\bin\Debug\TimeOver.wav
文件 335360 2016-11-22 21:25 Counter\Counter\bin\Debug\宏信证券-倒计时工具.exe
文件 231 2016-11-24 22:37 Counter\Counter\bin\Release\config.ini
文件 337408 2016-11-24 22:55 Counter\Counter\bin\Release\Counter.exe
文件 117 2016-11-22 21:24 Counter\Counter\bin\Release\Counter.exe.config
文件 11608 2016-12-02 20:34 Counter\Counter\bin\Release\Counter.vshost.exe
文件 117 2016-11-22 21:24 Counter\Counter\bin\Release\Counter.vshost.exe.config
文件 490 2010-03-18 12:39 Counter\Counter\bin\Release\Counter.vshost.exe.manifest
文件 231 2016-11-24 22:37 Counter\Counter\bin\宏信证券-倒计时工具\config.ini
文件 337408 2016-11-24 22:55 Counter\Counter\bin\宏信证券-倒计时工具\宏信证券-倒计时工具.exe
文件 159739 2016-11-22 21:25 Counter\Counter\clock.ico
文件 3945 2016-11-22 21:25 Counter\Counter\Counter.csproj
文件 9073 2016-11-24 22:55 Counter\Counter\Form1.cs
文件 19469 2016-11-24 22:52 Counter\Counter\Form1.Designer.cs
文件 245925 2016-11-24 22:52 Counter\Counter\Form1.resx
文件 732 2016-11-24 22:18 Counter\Counter\obj\x86\Debug\Counter.csproj.FileListAbsolute.txt
文件 975 2016-11-24 22:55 Counter\Counter\obj\x86\Debug\Counter.csproj.GenerateResource.Cache
文件 337920 2016-11-24 22:55 Counter\Counter\obj\x86\Debug\Counter.exe
文件 160305 2016-11-24 22:55 Counter\Counter\obj\x86\Debug\Counter.Form1.resources
文件 34304 2016-11-24 22:55 Counter\Counter\obj\x86\Debug\Counter.pdb
文件 180 2016-11-22 21:25 Counter\Counter\obj\x86\Debug\Counter.Properties.Resources.resources
文件 6518 2016-11-24 22:18 Counter\Counter\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache
文件 5849 2016-11-24 22:55 Counter\Counter\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
............此处省略41个文件信息
相关资源
- C# TIP文件生成和拆解
- C#解析HL7消息的库135797
- C# OCR数字识别实例,采用TessnetOcr,对
- 考试管理系统 - C#源码
- asp.net C#购物车源代码
- C#实时网络流量监听源码
- C#百度地图源码
- Visual C#.2010从入门到精通配套源程序
- C# 软件版本更新
- C#屏幕软键盘源码,可以自己定制界面
- 智慧城市 智能家居 C# 源代码
- c#获取mobile手机的IMEI和IMSI
- C#实现简单QQ聊天程序
- 操作系统 模拟的 欢迎下载 C#版
- C#写的计算机性能监控程序
- 用C#实现邮件发送,有点类似于outlo
- MVC model层代码生成器 C#
- c#小型图书销售系统
- C# Socket Server Client 通讯应用 完整的服
- c# winform 自动登录 百度账户 源代码
- C#编写的16进制计算器
- C#TCP通信协议
- C# 数据表(Dataset)操作 合并 查询一
- C#语音识别系统speechsdk51,SpeechSDK51L
- 数据库备份还原工具1.0 C# 源码
-
[免费]xm
lDocument 节点遍历C# - EQ2008LEDc#开发实例
- DirectX.Capturec# winform 操作摄像头录像附
- c# 实现的最大最小距离方法对鸢尾花
- C#版保龄球记分代码
评论
共有 条评论