100分!!!请问,如何实现类似于 windiff的文本比较功能?有没有现成是组件或第三方控件啊? 100分!!!请问,如何实现类似于 windiff的文本比较功能?有没有现成是组件或第三方控件啊?就是说,给你2个文本字符串,要求输出一张对比表格,分别用不同的颜色标示出2个文本不同的地方。请有相关经验的高手帮忙,谢谢拉! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 windiff我都用过,不知道你要的是不是这样的效果 private ArrayList CompTwoString(string A,string B) { ArrayList al =new ArrayList(); string[] result =new string[2]{string.Empty,string.Empty}; char[] As =A.ToCharArray(); char[] Bs =B.ToCharArray(); int CompCount =(As.Length<Bs.Length?As.Length:Bs.Length); for(int i=0;i<CompCount;i++) { if(As[i]==Bs[i]) { result[0] +=As[i].ToString(); result[1] +=Bs[i].ToString(); } else { result[0]+=("<FONT color='red' face='宋体'>"+As[i]+"</FONT>"); result[1]+=("<FONT color='red' face='宋体'>"+Bs[i]+"</FONT>"); } } if(A.Length>CompCount) result[0]+=("<FONT color='red' face='宋体'>"+A.Substring(CompCount,A.Length-CompCount)+"</FONT>"); if(B.Length>CompCount) result[1]+=("<FONT color='red' face='宋体'>"+B.Substring(CompCount,B.Length-CompCount)+"</FONT>"); al.Add(result[0]); al.Add(result[1]); return al; } private void Button2_Click(object sender, System.EventArgs e) { DataGrid1.DataSource =CompTwoString("abcdess","axcdsadsfds"); DataGrid1.DataBind(); } 网站出错啦! checkboxlist 纵向间距离 ,如何调整 用GDI+怎么实现绘制倾斜 关于自定义函数AddTree在asp.net中以vb实现 的问题 发布本站源程序 郁闷,献一个“抓取aspx呈现的html代码程序”来痛快一下... 如何将一张大图片切割成多张图片,然后在html中连接起来就像是一张整图一样?你们一般用什么办法比较精确? 新站开始运行了 怎么实现类似于新闻组或水木那种效果的论坛 求一段代码。关于缓存的remove时候,帮忙解决一下。~~~~~~~~~~~~~~~~~~~~~ 怎样在解决方案的根目录建立一个aspx文件呢 有没有基于web页面的复杂组合查询的例子??
private ArrayList CompTwoString(string A,string B)
{
ArrayList al =new ArrayList();
string[] result =new string[2]{string.Empty,string.Empty};
char[] As =A.ToCharArray();
char[] Bs =B.ToCharArray();
int CompCount =(As.Length<Bs.Length?As.Length:Bs.Length);
for(int i=0;i<CompCount;i++)
{
if(As[i]==Bs[i])
{
result[0] +=As[i].ToString();
result[1] +=Bs[i].ToString();
}
else
{
result[0]+=("<FONT color='red' face='宋体'>"+As[i]+"</FONT>");
result[1]+=("<FONT color='red' face='宋体'>"+Bs[i]+"</FONT>");
}
}
if(A.Length>CompCount)
result[0]+=("<FONT color='red' face='宋体'>"+A.Substring(CompCount,A.Length-CompCount)+"</FONT>");
if(B.Length>CompCount)
result[1]+=("<FONT color='red' face='宋体'>"+B.Substring(CompCount,B.Length-CompCount)+"</FONT>"); al.Add(result[0]);
al.Add(result[1]); return al;
}
private void Button2_Click(object sender, System.EventArgs e)
{ DataGrid1.DataSource =CompTwoString("abcdess","axcdsadsfds");
DataGrid1.DataBind(); }