need some result font color help

i have the below c# code where I want the color of the success message to be green and the failure to be red. The resutls get displayed on a .net/html text box

How can i do this?

protected void tibco_click(object sender, EventArgs e) { ResultBox.Text = string.Empty; var shell = PowerShell.Create(); PSCommand myCmd; myCmd = shell.Commands.AddScript("C:script.ps1"); myCmd.AddParameter("ForceUpgrade", Boolean.Parse("false")); string myRes = ""; var results = shell.Invoke(); if (results.Count > 0) { var builder = new StringBuilder(); foreach (var psObject in results) { builder.Append(((String)psObject.BaseObject)); myRes = (String)psObject.BaseObject; } if (myRes.IndexOf("<RetailerGuid>b7e3c8aa-a3c5-4822-ac52- f15f49de9330</RetailerGuid>") == -1) { ResultBox.Text = "Failure" } else { ResultBox.Text = "Success"; } } 

submitted by /u/brownman0123
[link] [comments]

Leave a Reply