如题.
类似于博客园,CSDN博客中发表新随笔时,C#语法高亮显示效果.就像在VS编辑环境中一样的效果..

解决方案 »

  1.   

    #region 返回搜索红色关键词 replacered
        public static string replacered(string title, string redkey)
        {
            title = title.Replace(redkey, "<font color='#ff0000'>" + redkey + "</font>");
            return title;
        }
        #endregion
      

  2.   


    .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>
    以上的请参考。
      

  3.   


    这种效果么?http://www.51aspx.com/CV/MinbelNews/App-Code/CsharpBean.cs.html
      

  4.   

    使用正则表达式,把匹配的C#关键字替换为<font>标签包含的内容。
    正则表达式到网上应该能搜到,这里我就不写代码了。
    如果楼主强烈需要,我可以写一段代码。
      

  5.   

    参考这篇文章 http://blog.csdn.net/libra1983/archive/2006/12/08/1434436.aspx
      

  6.   

    正则啊
     string AV2Color(string tmpStr)
        {
            string reValue = tmpStr;
            string xingcheng = @"([a-zA-Z]{6}&nbsp;)";
            reValue = Regex.Replace(reValue, xingcheng, "<font color=yellow>$1</font>");
        }举一反三
      

  7.   

    能有下面这个效果,格式
    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.");
        }
    }
      

  8.   


    孟子都来了,说去GOOGLE
    俺会搜索引擎,开此帖本想征集兄弟们自己的方法,肯定各有不同,各有优点不管结果如何,明天早上结帖
      

  9.   

    楼主,其实我也在找博客园的语法高亮的实现方法....
    幸运的是我虽然没有找到,这样的语法高亮的方法,(这种可能是你我常见的那种)
    例如:http://www.cnblogs.com/flyingis/archive/2008/04/08/1141839.html
    不过,我找到了一种语法高亮的方法...呵呵...
    例如:http://www.cnblogs.com/macleo/archive/2008/07/03/1234423.html
    接分,我是接不到了...不过到愿意和你一起找一下另一种语法高亮的方法....联系我,请留言...呵呵