Finding the Longest substring in a string that is a palindrome

Hi, Recently my friend asked me this question so gave it a try and got it. So this is how the code goes: using System; using System.Collections.Generic; using System.Linq; namespace SubStringPalindrome { class Program { static int maxLength; static void Main(string[] args) { string inputString = “ootntannanitindennedadinidadeleveledaibohphobiatattarrattat”; string currentStr = string.Empty; List<string> listOfPalindromes = new […]

‘yield’ Keyword in C#

Hi, This post is mainly about the ‘yield’ keyword provided in C#. I never really got a chance to use this keyword until now. So thought I would just blog about it. This blog is not of my own writing; I would say it is rather a re-blogging of a discussion about the keyword in […]

Accessing impersonated user’s details from code behind in C#

Hi all, Many of us might know that in web development, config files play a very important role. Reading config file entries in a code-behind file is a very common thing in web development. Config entries are stored in web.config file in the <appSettings> tag and can be accessed using System.Configuration.ConfigurationManager.AppSettings[“keyName”]; But there might be […]

Uploading large files using and IIS6.0

Hi, We all must have obviously uploaded files somewhere or the other. Even in the websites that we create using ASP.NET, we might have to put the asp:fileupload control to facilitate file upload feature. While developing websites or web applications, we might come across requirements that specify: Allow users to upload large files (file size […]

Error Condition: HttpException: maxRequestLength exceeded. ASP.NET

Hi, While building ASP.NET web applications, we all would have almost certainly used the file upload control. But sometimes, we might encounter an exception message which reads, “System.Web.HttpException: maxRequestLength exceeded”. The cause of this exception is simple. “maxRequestLength” attribute of the “httpRuntime” tag specifies the maximum size of input files that can be uploaded. By […]