hello all ,
Here i am doing display one error Message like "politisians should not be lazy" like below. so i am getting default fore color (black)of error Message . i need red color...
TypeScript
default = politisians should not be lazy
need = politisians should not be lazy
try
{
IndiaAssemblies.ForEach(delegate(Indiaassembly e)
{
if (string.IsNullOrEmpty(e.politisians))
{
throw new System.DataMisalignedException("politisians should not be lazy");
}
});
}
catch (Exception ex)
{
return RedirectToAction("Indiaparlement", "INDIA", new { somex = objindia.somex.ToString(),
Revision = objindia.Revision.ToString(), errormsg = ex.Message });
}Thanks
Hareesh
Noaman Khalil30 pointsPosted Jan 1, 2015, 4:40 AM EST
put this line of code one the line before"politisians should not be lazy" (code is below)
Console.ForegroundColor = ConsoleColor.Red;
this code will add color to that specific line
after the line "politisians should not be lazy"
Console.ResetColor();
and this line of code will make the color black again
reference
http://www.dotnetperls.com/console-color
Noaman Khalil30 pointsPosted Jan 5, 2015, 7:10 AM EST
i am a novice programmer just started less than 2 months back
if you have time to help please goto one of my questions !
http://www.c-sharpcorner.com/Forums/Thread/280600/
1 short reply
Hari B105 pointsPosted Jan 5, 2015, 12:53 AM EST