ASP.NET
  Home arrow ASP.NET arrow Page 2 - Completing an In-Text Advertising System u...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ASP.NET

Completing an In-Text Advertising System under an ASP.NET 3.5 Environment
By: Xianzhong Zhu
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 4
    2009-01-28

    Table of Contents:
  • Completing an In-Text Advertising System under an ASP.NET 3.5 Environment
  • The Verification Code
  • The Member Center: the siteUser.aspx page
  • Manage the Ad Keywords
  • Manage the Ad Contents

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Completing an In-Text Advertising System under an ASP.NET 3.5 Environment - The Verification Code


    (Page 2 of 5 )

    As hinted above, the verification code is generated through the "Gif.aspx" page.  Looking closely, you will find that the HTML coding of this page is empty, and all of the implementation logic is performed by invoking the ValidateCode server-side class, with which we generate the verification code-related picture. Below I've given the code for the gif.aspx.cs file:

    protected void Page_Load(object sender, EventArgs e)

    {

    ValidateCode gif=new ValidateCode ();//verifying code

    string valid ="";

    MemoryStream ms = gif.Create ( out valid);

    Session["sdf"] = valid;//store the verifying code

    //first empty

    Response.ClearContent();

    Response.ContentType = "image/png";

    Response.BinaryWrite(ms.ToArray());//output in the picture format

    Response.End();

    }

    The principle used to generate the verifying code is: first generate a random number; use this number to generate a picture; put the picture into the memory stream; and finally output the picture from the memory stream to the web page. Since the implementation of the ValidateCode class is so tedious to code, we will not list it; you can refer to the downloadable source code for the details.

    More ASP.NET Articles
    More By Xianzhong Zhu


       · This is a very good article. Is there going to be another part to this series?
     

    ASP.NET ARTICLES

    - Adding Content to a Static ASP.NET Website
    - Building a Static ASP.NET Website in a Basic...
    - Develop Your First ASP.NET Website with Visu...
    - Run ASP.NET in Windows XP Home with Cassini ...
    - How to Test a Web Application
    - How to Add Code and Validation Controls to a...
    - Working in Source and Split Views to Build a...
    - How to Build a Web Form for a One-Page Web A...
    - How to Develop a One-Page Web Application
    - An ASP.NET Web Application in Action
    - Developing ASP.NET Web Applications
    - An Introduction to ASP.NET Web Programming
    - Introduction to the ADO.NET Entity Framework...
    - Completing an In-Text Advertising System und...
    - Programming an In-Text Advertising System un...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek