Simple example and description of cookie programming in C #

Source: Internet
Author: User
This article introduces a simple example and description of cookie Programming in C #, and friends in Need can refer to the copy code code as follows:


using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Net; A summary description of the
namespace WebApplication5
{
 ///<summary>
 ///WebForm1.
 ///</summary>
 public class WebForm1:System.Web.UI.Page
 {
  protected Sys Tem. Web.UI.WebControls.TextBox TextBox1;
  private void Page_Load (object sender, System.EventArgs e)
  {
  //Place user code here to initialize page
   string   strhostip= "";  
   iphostentry   oiphost= Dns.resolve (environment.machinename);  
   if (oiphost.addresslist.length>0)    
    strhostip=oiphost.addresslist[0]. ToString ();  
   this. Textbox1.text=strhostip;
 }
  #region The code generated by the Web Forms Designer
  override protected void OnInit (EventArgs e)
  {
  //
  //CodeGen: This call is required for the ASP.net Web forms Designer.
  //
   InitializeComponent ();
   base. OnInit (e);
 }
 ///<summary>
 ///Designer supports the desired method-do not use the Code Editor to modify
 ///The contents of this method.
 ///</summary>
  private void InitializeComponent ()
  {   
    this. Load + = new System.EventHandler (this. Page_Load);
 }
  #endregion
 }
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.