| SmsX1.Close (); Wy12;iuCf } wZH7(&l96a Z>oPl{|.|S private void SmsTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) O ,"mLE[ { O3Y0#^ //当f:\sms\data\filetosend有文件时,先关闭时钟,将其发送出去,并删除掉文件再启动时钟 kIX*rq # this.SmsTimer.Enabled =false; 81o^PdK g A[wO@ //目录对象 ?k'zKV[c DirectoryInfo cd = new System.IO.DirectoryInfo(F:\\Sms\\Data\\FileToSend); #}hzU q //数据库记录变量 #"KTqqH string rsId; x(,`6 :kd string rsPhoneNum; v~&-p"OA'/ string rsSmsText; [Q #u4Fx }k 0 8}Rv string StrSql; V}SN}4$L g8DH; =t //首先,在当前目录中列举当前的所有SMS文件 ]QA B_ foreach(FileInfo FileSend in cd.GetFiles ()) 7w|Y "`g { >1" ZIwp& try .=>Kw { }c8M,5c //依次打开每个文件读取文件内容 < z/ yQJ FileStream fs = new FileStream (cd.FullName \\ FileSend.Name,FileMode.Open,FileAccess.Read ); P"DFkc StreamReader sr; mG)y 3G
|
| 共10页: 上一页 [1] [2] [3] [4] [5] 6 [7] [8] [9] [10] 下一页 |
评论加载中…