开发来电显示及录音程序的C#范例 |
chen在2010/3/7发表,被浏览9126次
此文章共有 2 页
1
2
|
//写INI文件 public void IniWriteValue(string Section, string Key, string Value) { WritePrivateProfileString(Section, Key, Value, this.Path); } //读取INI文件指定 public string IniReadValue(string Section, string Key, string Default) { StringBuilder temp = new StringBuilder(255); int i = GetPrivateProfileString(Section, Key, Default, temp, 255, this.Path); return temp.ToString(); } /// 验证文件是否存在 public bool IniExistFile() { return File.Exists(this.Path); } } //=============================================================== public enum JDStatus : byte { Idel = 0, Ring = 1, Talk = 2, Dial = 3 }; //0 空闲;1 等待接通;2 正在通话;3 正在拨号 public class TPressKey { public string id; public string devid; public string wavfile; public DateTime t; public JDStatus b; public void initPressKey() { id = ""; devid = ""; wavfile = ""; t = DateTime.Now; b = JDStatus.Idel; } public int keyInterval() { return (int)((DateTime.Now.Ticks - t.Ticks) / 10000); //毫秒 } public void setStatus(JDStatus status) { b = status; t = DateTime.Now; } } } }
|
|
|
|