Showing posts from 2011

Dynamically Creating Image in C#.Net

              As per the requirement from one of my client, an image should be generated dynamically by taking the necessary information from the user.  When I went on a search, I came to know that, my crazy DotNet framework provided my two namespaces System.Drawing and System.Drawing.Imaging.  It’s enough to learn three classes from these namespaces - Bitmap and Graphics for generating an image dynamically related to System.Drawing Namespace and FileFormat class is for saving the created image in different file formats and is related to System.Drawing.Imaging Namespace.             Bitmap class is useful to generate a new image and to save it different file formats.  Graphics class is useful to design the image using lines, curves, rectangles, text etc., with colors and everything.  FileFormat class is useful to save the file in a particular or in different formats like Jpeg, Png, Bmp etc.  The default format is png.                         Now lets jump into code.  After

Custom Error Pages In ASP.NET

* Errors And Exceptions In ASP.NET - covers different kinds of errors, try-catch blocks, introduces Exception object, throwing an exception and page_error procedure. * Application Level Error Handling in ASP.NET - goes a level higher and explains handling of unhandled errors by using Application_Error procedure in Global.asax file, using of custom Http modules, sending notification e-mail to administrator, show different error pages based on roles and logging errors to text files, database or EventLog. This tutorial deals with user experience when error occurs. When error is occurred on ASP.NET web application, user will get default error page (which is not so nice looking, also known as "Yellow screen of death"). This error page confuses average visitor who don't know the meaning of "Runtime Error". Although developers like to know many details about an error, it is better to show more friendly error page to your users.           Web.config file c


INTRODUCTION :-                 One of my clients required a desk top application that maintains contacts in a database and sends emails to the contacts in the database.  They have not provided the credentials and the details of mail server.  So I created an application that uses outlook for sending mails by using the credentials preconfigured by the outlook account.  This application can send email for multiple email accounts and with or without attachments. FEATURES :- ·          Sending mails to multiple email accounts at a time. ·          Using configured outlook credentials. ·          No need of configuring credentials every time. ·          Sending mails with attachments. CODE EXPLANATION :-                 Create new project and add references as follows.  These files can be downloaded or can be achieved by the sample project which is attached with this article. Interop.Microsoft.Office.Core.dll Interop.Outlook.dll Let’s go to code part.  Import the fo

Visual Studio 11

    Today in the  BUILD  keynote I had the opportunity to show some of the new functionality in Microsoft® Visual Studio® 11 Developer Preview and Microsoft® Team Foundation Server Preview.  MSDN subscribers can download the previews today as well as the new release of .NET Framework 4.5 Developer Preview; general availability is on Friday, September 16. Download  Visual Studio 11 ,  Team Foundation Server 11 , and several other components today ( MSDN Subscribers Only Downloads ). Friday 10:00 AM PDT general availability  for  Visual Studio 11  and  Team Foundation Server 11  can be downloaded. Some exciting announcements are being made here at BUILD.  Visual Studio 11 provides an integrated development experience that spans the entire lifecycle of software creation  from architecture to code creation, testing and beyond. This release adds support for Windows 8 and HTML 5, enabling you to target platforms across devices, services and the cloud.  Integration with Team Foundati

Image Thumbnail Creation using C#.Net

Download Source /Example Here Introduction :-             This tutorial will show you how to generate image thumbnails dynamically from an original big image. Background :-             Many of the web developers will show the big images as small by giving the attribute values for the image tag.  This will slow down the webpage loading.  For better performance the best method is creating the small thumbnail images for showing small size image on the web pages.  But for every upload of the images by the user we cannot create a thumbnail image, it’s a tedious process.  I planed to create a method which will create a thumbnail automatically while the image upload and saves in a separate path.  This is a light weight process and easy to use.  The only thing is you have to add one more filed for saving the thumbnail image path while dealing with databases. Following are the features of this technique. Good Quality. Desired thumbnail size. Using the