摘要: 在 stream流 和 byte[] 中查找(搜索)指定字符串这里注重看的是两个 Search 的扩展方法,一个是 stream类型的扩展,另一个是 byte[] 类型的扩展,如果大家有更好的“算法”,请给回复,我们一起优化!-- 常用扩展代码,需要这部分代码的支持!using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.IO;using System.Drawing;namespace Ims.Bll{ /// <summary> /// stre 阅读全文
posted @ 2012-04-26 14:02 草青工作室 阅读(265) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.IO;using System.Drawing;namespace Ims.Bll{ /// <summary> /// stream 、 string 、byte[] 间的转换扩展方法类 /// </summary> public static class StreamExtend { #region Stream 扩展 /// <summary> /// Stream 阅读全文
posted @ 2012-04-26 10:49 草青工作室 阅读(205) 评论(0) 推荐(0) 编辑
摘要: 字符串string和内存流MemoryStream及比特数组byte[]互转比较定义string变量为str,内存流变量为ms,比特数组为bt1.字符串转比特数组(1)byte[] bt=System.Text.Encoding.Default.GetBytes("字符串");(2)byte[] bt=Convert.FromBase64String("字符串");2.字符串转流(1)MemoryStream ms=new MemoryStream(System.Text.Encoding.Default.GetBytes("字符串" 阅读全文
posted @ 2012-04-26 10:09 草青工作室 阅读(285) 评论(0) 推荐(0) 编辑