能有下面这个效果,格式 using System; using System.Threading; public class Example { public static void Main() { // Queue the task. ThreadPool.QueueUserWorkItem(new WaitCallback(ThreadProc)); Console.WriteLine("Main thread does some work, then sleeps."); // If you comment out the Sleep, the main thread exits before // the thread pool task runs. The thread pool uses background // threads, which do not keep the application running. (This // is a simple example of a race condition.) Thread.Sleep(1000); Console.WriteLine("Main thread exits."); } // This thread procedure performs the task. static void ThreadProc(Object stateInfo) { // No state object was passed to QueueUserWorkItem, so // stateInfo is null. Console.WriteLine("Hello from the thread pool."); } }
public static string replacered(string title, string redkey)
{
title = title.Replace(redkey, "<font color='#ff0000'>" + redkey + "</font>");
return title;
}
#endregion
.c1
{
background-color:#ffffff;
}
.c2
{
background-color:#fffdd7;
}function ChangeStyle(obj,Value)
{
obj.className=Value;
}<div onmousemove="ChangeStyle(this,'c2')" onmouseout ="ChangeStyle(this,'c1')">
Text
</div>
以上的请参考。
这种效果么?http://www.51aspx.com/CV/MinbelNews/App-Code/CsharpBean.cs.html
正则表达式到网上应该能搜到,这里我就不写代码了。
如果楼主强烈需要,我可以写一段代码。
string AV2Color(string tmpStr)
{
string reValue = tmpStr;
string xingcheng = @"([a-zA-Z]{6} )";
reValue = Regex.Replace(reValue, xingcheng, "<font color=yellow>$1</font>");
}举一反三
using System;
using System.Threading;
public class Example {
public static void Main() {
// Queue the task.
ThreadPool.QueueUserWorkItem(new WaitCallback(ThreadProc)); Console.WriteLine("Main thread does some work, then sleeps.");
// If you comment out the Sleep, the main thread exits before
// the thread pool task runs. The thread pool uses background
// threads, which do not keep the application running. (This
// is a simple example of a race condition.)
Thread.Sleep(1000); Console.WriteLine("Main thread exits.");
} // This thread procedure performs the task.
static void ThreadProc(Object stateInfo) {
// No state object was passed to QueueUserWorkItem, so
// stateInfo is null.
Console.WriteLine("Hello from the thread pool.");
}
}
孟子都来了,说去GOOGLE
俺会搜索引擎,开此帖本想征集兄弟们自己的方法,肯定各有不同,各有优点不管结果如何,明天早上结帖
幸运的是我虽然没有找到,这样的语法高亮的方法,(这种可能是你我常见的那种)
例如:http://www.cnblogs.com/flyingis/archive/2008/04/08/1141839.html
不过,我找到了一种语法高亮的方法...呵呵...
例如:http://www.cnblogs.com/macleo/archive/2008/07/03/1234423.html
接分,我是接不到了...不过到愿意和你一起找一下另一种语法高亮的方法....联系我,请留言...呵呵