凌凯彩信工具包

时间:2016-01-02 10:14:54
【文件属性】:

文件名称:凌凯彩信工具包

文件大小:3.28MB

文件格式:RAR

更新时间:2016-01-02 10:14:54

彩信工具

开发语言 C# static byte[] MakeTmsContent(String fileWholeName) { byte[] buffer = null; FileInfo finfo = new FileInfo(fileWholeName); if (!finfo.Exists) return buffer; using (MemoryStream ms = new MemoryStream()) { using (BinaryWriter wr = new BinaryWriter(ms)) { using (FileStream fs = new FileStream(finfo.FullName, FileMode.Open)) { using (BinaryReader bread = new BinaryReader(fs)) { int filelen = (int)fs.Length; byte[] fname = Encoding.ASCII.GetBytes(finfo.Name+"\0"); byte[] content = bread.ReadBytes(filelen); wr.Write(fname, 0,fname.Length); wr.Write(filelen); wr.Write(content,0, content.Length); bread.Close(); } fs.Close(); } wr.Close(); } buffer = ms.ToArray(); ms.Close(); } return buffer; }


网友评论