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

推荐订阅源

Jina AI
Jina AI
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
有赞技术团队
有赞技术团队
罗磊的独立博客
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
U
Unit 42
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Recent Announcements
Recent Announcements
Y
Y Combinator Blog
Vercel News
Vercel News
Martin Fowler
Martin Fowler
V
V2EX
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
L
LangChain Blog
云风的 BLOG
云风的 BLOG
H
Hackread – Cybersecurity News, Data Breaches, AI and More
aimingoo的专栏
aimingoo的专栏
G
Google Developers Blog
The GitHub Blog
The GitHub Blog
N
Netflix TechBlog - Medium
Google DeepMind News
Google DeepMind News
雷峰网
雷峰网
阮一峰的网络日志
阮一峰的网络日志
F
Fortinet All Blogs

博客园 - 小迪

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>"
        }