当前位置 : 主页 > 网络编程 > net编程 >

代码高亮插件 c#(asp.net)

来源:互联网 收集:自由互联 发布时间:2023-10-08
csdn高亮也是这个 protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { CodeHighlighterConfiguration config = ConfigurationManager.GetSection("codeHighlighter") as CodeHighlighterConfiguration; string[] keys = new s
csdn高亮也是这个
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
CodeHighlighterConfiguration config = ConfigurationManager.GetSection("codeHighlighter") as CodeHighlighterConfiguration;
string[] keys = new string[config.LanguageConfigs.Keys.Count];
config.LanguageConfigs.Keys.CopyTo(keys, 0);
Array.Sort(keys);
foreach (string key in keys)
{
LanguageDropDownList.Items.Add(key);
}
LanguageDropDownList.SelectedIndex = LanguageDropDownList.Items.IndexOf(LanguageDropDownList.Items.FindByText("C#"));
}
}

protected void HighlightButton_Click(object sender, EventArgs e)
{

// HighlightButton.Enabled = false;

FileSizeLabel.Text = CodeTextBox.Text.Length.ToString();
OutputTextBox.Text =null;

Highlighter.LanguageKey = LanguageDropDownList.SelectedItem.Text;

Highlighter.OutliningEnabled = OutliningEnabledCheckBox.Checked;
Highlighter.LineNumberMarginVisible = LineNumberMarginVisibleCheckBox.Checked;

Highlighter.Text = CodeTextBox.Text;

ResultsPanel.Visible = true;
}



protected void CodeHighlighter_PostRender(object sender, EventArgs e)
{
OutputTextBox.Text = Highlighter.Output;
}

​​下载​​




上一篇:C#编程:文件版本号的读取和设置
下一篇:没有了
网友评论