
December 2, 2014 10:27 by
Dan

Introduction
ASP.NET 4.0 is a version that launch after ASP.NET 3.5 version. ASP.NET is an open source server-side Web application framework designed for Web development to produce dynamic Web pages. It was developed by Microsoft to allow programmers to build dynamic web sites, web applications and web services. Today we will discuss about "How to Fix Register ASP.net 4.0 With IIS Windows Server 2012".
Issue
Chanced upon an issue where Asp.net 4.0 wasn't enlisted with IIS running on Windows Server 2012. Prior to that Server OS the arrangement was a simple one: just take after this posting of mine and all is fine once more.
Notwithstanding, Windows Server 2012 and later don't help that any longer and the ONLY alter is evacuating IIS and reinstalling it with Asp.net 4.0. Anyway that is an excessive amount of and takes an excess of time, exertion and assets.
Quick Fix
This is the step to fix this problem WITHOUT removing and reinstalling IIS:
- Open IIS Manager and select the webserver and select Modules (found under header IIS);
- Double click on it, so you open Modules, and remove the module ServiceModel;
- Go back to IIS Manager, select the webserver again in IIS, and select Handler Mappings (found under header IIS);
- Remove the handler svc-Integrated;
- Restart IIS by using an elevated cmd prompt and issue this command: IISRESET <enter>;
- When IIS is running again add WCF by going to "Turn Windows Features On and Off" and enable .NET Framework 4.5 Features > WCF Services > HTTP Activation;
- Restart IIS by using an elevated cmd prompt and issue this command: IISRESET <enter>
Now the SCOM 2012 Web Console will be fully functional WITHOUT reinstalling IIS.
dcff7129-d391-46eb-b9ba-17ef7853c984|0|.0

December 1, 2014 06:07 by
Mark
Implement a simple captcha in C# .NET

- Create a page with name “Captcha.aspx”
- Place the following html code in body part of the page
IMG height="30" alt="" src=BuildCaptcha.aspx width="80">
asp:TextBox runat="Server" ID="txtCaptcha">
<asp:Button runat="Server" ID="btnSubmit"
OnClick="btnSubmit_Click"
Text="Submit" />
On “btnSubmit_Click” place the following code
if (Page.IsValid && (txtCaptcha.Text.ToString() ==
Session["RandomStr"].ToString()))
{
Response.Write("Code verification Successful");
}
else
{
Response.Write( "Please enter info correctly");
}
- Include the following code in “BuildCaptcha.aspx"
Bitmap objBMP = new Bitmap(60, 20);
Graphics objGraphics = Graphics.FromImage(objBMP);
objGraphics.Clear(Color.Wheat);
objGraphics.TextRenderingHint = TextRenderingHint.AntiAlias;
//' Configure font to use for text
Font objFont = new Font("Arial", 8, FontStyle.Italic);
string randomStr = "";
char[] myArray = new char[5];
int x;
//That is to create the random # and add it to our string
Random autoRand = new Random();
for (x = 0; x < 5; x++)
{
myArray[x] = System.Convert.ToChar(autoRand.Next(65,90));
randomStr += (myArray[x].ToString());
}
//This is to add the string to session, to be compared later
Session.Add("RandomStr", randomStr);
//' Write out the text
objGraphics.DrawString(randomStr, objFont, Brushes.Red, 3, 3);
//' Set the content type and return the image
Response.ContentType = "image/GIF";
objBMP.Save(Response.OutputStream, ImageFormat.Gif);
objFont.Dispose();
objGraphics.Dispose();
objBMP.Dispose();
There you go you can test the page with captcha. Happy Programming 
df44d5b2-5d73-4197-9cb6-1c2ca5f01a23|0|.0