Posted 16 years ago by KenA
Hi ... I need some help in converting the PasteCode.aspx VB to C#

== =================================
string key
if( !Page.IsPostBack )
CodeHighlighterConfiguration config = CType( ConfigurationSettings.GetConfig("codeHighlighter"), CodeHighlighterConfiguration);

foreach( key in config.LanguageConfigs.Keys )

Ken A.

Comments (2)

Posted 16 years ago by Marianne
This is C#.

------------------------------- Marianne

Posted 15 years ago by Andrey Niedens
There is the C# code:

protected void Page_Load(object sender, EventArgs e)
CodeHighlighterConfiguration config = (CodeHighlighterConfiguration)ConfigurationSettings.GetConfig("codeHighlighter");
foreach(string key in config.LanguageConfigs.Keys)

protected void HighlightButton_Click(object sender, EventArgs e)
//Disable the button
this.HighlightButton.Enabled = false;

//Update labels
this.FileSizeLabel.Text = CodeTextBox.Text.Length.ToString();
OutputTextBox.Text = "";

//Set the language key
Highlighter.LanguageKey = LanguageDropDownList.SelectedItem.Text;

//Set whether to allow outlining and line numbering
Highlighter.OutliningEnabled = this.OutliningEnabledCheckBox.Checked;
Highlighter.LineNumberMarginVisible = this.LineNumberMarginVisibleCheckBox.Checked;

//Set the code to the highlighter
Highlighter.Text = CodeTextBox.Text;

//Show the results panel
ResultsPanel.Visible = true;
The latest build of this product (v4.0.0059) was released 10 years ago, which was after the last post in this thread.