惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
SegmentFault 最新的问题
Google DeepMind News
Google DeepMind News
G
Google Developers Blog
Martin Fowler
Martin Fowler
MongoDB | Blog
MongoDB | Blog
月光博客
月光博客
Jina AI
Jina AI
宝玉的分享
宝玉的分享
人人都是产品经理
人人都是产品经理
D
DataBreaches.Net
V
V2EX
WordPress大学
WordPress大学
T
The Blog of Author Tim Ferriss
Last Week in AI
Last Week in AI
B
Blog
博客园 - 叶小钗
小众软件
小众软件
Stack Overflow Blog
Stack Overflow Blog
P
Proofpoint News Feed
A
About on SuperTechFans
J
Java Code Geeks
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Y
Y Combinator Blog
Microsoft Security Blog
Microsoft Security Blog

博客园 - 小迪

A potentially dangerous Request.Form value was detected from the client - 小迪 图片翻页滚动效果(JavaScript) 在网上找到一个.net的打印类,打印Dataset的,不错,保存于止 .NET 1.1移植到.NET 2.0出现的一些小问题的解决 授权 多个Main函数的应用程序 base Server的Transfer和Response的Redirect 缓存 FreeTextBox .Net Reflection and Performance 比较动态调用代码 稍不留神产生代码垃圾 using的几种用法 C#中"is" vs "as" 设置文本框光标的位置 System.Environment.UserDomainName 为什么不返回 当前的 Domainname 49.7 天后就不正常工作了 文件太新了也有错误? .exe.config 类型文件自动更新的问题.
Highlight - 小迪 - 博客园
小迪 · 2006-04-21 · via 博客园 - 小迪

        <style type="text/css">
        .highlight 
{ FONT-WEIGHT: bold; BACKGROUND: blue; COLOR: white; TEXT-DECORATION: none }
        
</style>

        private void Page_Load(object sender, System.EventArgs e)
        
{
            
// Put user code to initialize the page here
            lblTxt.Text = "Give the proper respect to hand-coding.You should both respect and loathe handwritten code. You should respect it because there are often special cases integrated into code that are overlooked with a cursory inspection. When replacing code you’ve written by hand, you need to make sure you have the special cases accounted for. You should loathe hand-code because engineering time is extremely valuable, and to waste it on repetitive tasks is nearly criminal. The goal of your generator should always be to optimize the organization’s most valuable assets.the creativity and enthusiasm of the engineering team."
        }


        
private void btnSubmit_Click(object sender, System.EventArgs e)
        
{
            lblTxt.Text 
= ToHighlight(txtKeywords.Text, lblTxt.Text);        
        }

        public string ToHighlight(string strSearch, string txtContent) 
        

            Regex RegExp 
= new Regex(strSearch.Replace(" ""|").Trim(), RegexOptions.IgnoreCase);
            
return RegExp.Replace(txtContent, new MatchEvaluator(ReplaceKeyWords));             
        }


        
public string ReplaceKeyWords(Match m) 
        
{
            
return "<span class=highlight>" + m.Value + "</span>"
        }