c#报时程序

时间:2015-01-01 05:18:23
【文件属性】:

文件名称:c#报时程序

文件大小:367KB

文件格式:RAR

更新时间:2015-01-01 05:18:23

报时

主方法: System.Media.SoundPlayer sndPlayer; string sound = @"VoiceTime\TIMENOW.wav"; sndPlayer = new System.Media.SoundPlayer(sound); sndPlayer.PlaySync(); if (DateTime.Now.Hour >= 0 && DateTime.Now.Hour < 6) sound = @"VoiceTime\AM0.wav"; else if (DateTime.Now.Hour >= 6 && DateTime.Now.Hour < 12) sound = @"VoiceTime\AM1.wav"; else if (DateTime.Now.Hour >= 12 && DateTime.Now.Hour < 18) sound = @"VoiceTime\PM.wav"; else sound = @"VoiceTime\EM.wav"; sndPlayer = new System.Media.SoundPlayer(sound); sndPlayer.PlaySync(); int hours = DateTime.Now.Hour; if (hours > 12) hours = hours - 12; if (hours < 10) sound = @"VoiceTime\T0" + hours + ".wav"; else sound = @"VoiceTime\T" + hours + ".wav"; sndPlayer = new System.Media.SoundPlayer(sound); sndPlayer.PlaySync(); sound = @"VoiceTime\POINT.wav"; sndPlayer = new System.Media.SoundPlayer(sound); sndPlayer.PlaySync(); int min = DateTime.Now.Minute; if (min >= 0 && min < 10) sound = @"VoiceTime\T00.wav"; else if (min >= 10 && min < 20) sound = @"VoiceTime\T10.wav"; else if (min >= 20 && min < 30) sound = @"VoiceTime\T20.wav"; else if (min >= 30 && min < 40) sound = @"VoiceTime\T30.wav"; else if (min >= 40 && min < 50) sound = @"VoiceTime\T40.wav"; else if (min >= 50 && min < 60) sound = @"VoiceTime\T50.wav"; sndPlayer = new System.Media.SoundPlayer(sound); sndPlayer.PlaySync(); min = min % 10; if (min != 0) { sound = @"VoiceTime\T0" + min + ".wav"; sndPlayer = new System.Media.SoundPlayer(sound); sndPlayer.PlaySync(); } sound = @"VoiceTime\MIN.wav"; sndPlayer = new System.Media.SoundPlayer(sound); sndPlayer.PlaySync(); if (sndPlayer != null) { sndPlayer.Dispose(); sndPlayer = null; }


【文件预览】:
报时
----bin()
--------Release()
--------Debug()
----Form1.Designer.cs(3KB)
----报时.csproj(7KB)
----Program.cs(502B)
----obj()
--------Debug()
----Form1.cs(4KB)
----VoiceTime()
--------EM.wav(8KB)
--------TIMENOW.wav(19KB)
--------T01.wav(3KB)
--------T07.wav(7KB)
--------T09.wav(5KB)
--------AM1.wav(10KB)
--------AM0.wav(10KB)
--------T30.wav(10KB)
--------T11.wav(9KB)
--------T1.wav(3KB)
--------T2.wav(4KB)
--------T08.wav(5KB)
--------T00.wav(4KB)
--------T20.wav(9KB)
--------T02.wav(4KB)
--------T04.wav(8KB)
--------T05.wav(9KB)
--------T12.wav(7KB)
--------MIN.wav(5KB)
--------PM.wav(9KB)
--------POINT.wav(4KB)
--------T40.wav(11KB)
--------T50.wav(12KB)
--------T06.wav(5KB)
--------T10.wav(7KB)
--------T03.wav(8KB)
----报时.csproj.user(208B)
----Form1.resx(6KB)
----Properties()
--------Resources.resx(5KB)
--------Settings.settings(249B)
--------AssemblyInfo.cs(1KB)
--------Settings.Designer.cs(1KB)
--------Resources.Designer.cs(3KB)

网友评论

  • 不错的程序吗,但是不是我要的那种方法
  • 程序可以用,就是需要自己点报时