ASP.NetÖÐÓÃC#ʵÏÖÕ¾µã¼ÆÊýÆ÷Óû§¿Ø¼þ
asaxÎļþ£º
¡¡¡¡<%@ Control Language="c#" AutoEventWireup="false" Codebehind="counter.ascx.cs" Inherits="JiAnWeb.counter" TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%>
¡¡¡¡<LINK href="css.css" rel="stylesheet">
¡¡¡¡<FONT face="ËÎÌå">
¡¡¡¡<TABLE id="table_counter" cellSpacing="0" cellPadding="0" width="750" align="center" border="0"
¡¡¡¡runat="server">
¡¡¡¡<TR>
¡¡¡¡<TD style="HEIGHT: 23px" align="center" valign=middle><IMG height="1" alt="" src="pic\rightblueback.gif" width="700"></TD>
¡¡¡¡</TR>
¡¡¡¡<TR>
¡¡¡¡<TD align=center valign=middle></TD>
¡¡¡¡</TR>
¡¡¡¡</TABLE>
¡¡¡¡</FONT>
¡¡¡¡£££££££££££££££££££
¡¡¡¡.csÎļþ£º
¡¡¡¡namespace JiAnWeb
¡¡¡¡{
¡¡¡¡using System;
¡¡¡¡using System.Data;
¡¡¡¡using System.Drawing;
¡¡¡¡using System.Web;
¡¡¡¡using System.Web.UI.WebControls;
¡¡¡¡using System.Web.UI.HtmlControls;
¡¡¡¡
¡¡¡¡/// <summary>
¡¡¡¡/// counter µÄժҪ˵Ã÷¡£
¡¡¡¡/// </summary>
¡¡¡¡public class counter : System.Web.UI.UserControl
¡¡¡¡{
¡¡¡¡protected System.Web.UI.HtmlControls.HtmlTable table_counter;
¡¡¡¡
¡¡¡¡private void Page_Load(object sender, System.EventArgs e)
¡¡¡¡{
¡¡¡¡// ÔÚ´Ë´¦·ÅÖÃÓû§´úÂëÒÔ³õʼ»¯Ò³Ãæ
¡¡¡¡string filePath=System.Web.HttpContext.Current.Server.MapPath("hits.txt");
¡¡¡¡System.IO.StreamReader srReadLine = new System.IO.StreamReader(
¡¡¡¡System.IO.File.OpenRead(filePath),
¡¡¡¡System.Text.Encoding.ASCII);//Encoding.DefaultÊǶÁÖÐÎÄ
¡¡¡¡srReadLine.BaseStream.Seek(0, System.IO.SeekOrigin.Begin);//
¡¡¡¡string countStr="";
¡¡¡¡if (srReadLine.Peek() > -1)
¡¡¡¡{
¡¡¡¡countStr+=srReadLine.ReadLine();
¡¡¡¡}
¡¡¡¡int count=int.Parse(countStr)+1;
¡¡¡¡countStr=count.ToString();
¡¡¡¡srReadLine.Close();
¡¡¡¡table_counter.Rows[1].Cells[0].InnerHtml="<font color=\"#009900\">";
¡¡¡¡for (int i=0;i<countStr.Length;i++)
¡¡¡¡{
¡¡¡¡table_counter.Rows[1].Cells[0].InnerHtml=table_c
Ïà¹ØÎĵµ£º
³£ÓõÄϵÁл¯¶¨Ò壨using System.Xml.Serialization;£©
[XmlAttribute("name")] // ¶¨Òå<Tag name="…"></Tag>
[XmlElement("label")] // ¶¨Òå<label>…</label>
[XmlIgnoreAttrib ......
• ²»ÒªÊ¹Óò»±ØÒªµÄSession£¬ºÍASPÖÐÒ»Ñù£¬ÔÚ²»±ØÒªµÄʱºò²»ÒªÊ¹ÓÃSession
• ²»Ê¹Óò»±ØÒªµÄServer Control
• ²»Ê¹Óò»±ØÒªµÄViewState
• ²»ÒªÓÃExcepti ......
ÓÃASP.NETÓëSQL SERVER¿ÉÊÇÔµ·Ý×îºÃÁË£¬ÉÔ´óµÄ³ÌÐòÒ»°ãµÚÒ»ÏÈ¿¼ÂǵÄÊÇSQL SERVER£¬Ö»ÊÇһЩºÜ¿¼ÂǾ¼ÃµÄ²ÅʹÓÃACCESSµÈÁË¡£ÓÃSQL SERVER£¬ÎªÁËʹÊý¾Ý¿âµÄЧÂʸüºÃ£¬Ò»°ã¶¼»á²ÅÈ¡´æ´¢¹ý³Ì£¬Òò´æ´¢¹ý³ÌÖ´ÐÐËٶȿ죬²¢ÇÒ¿ÉÒÔʵÏÖһЩ¸ß¼¶µÄ²éѯµÈ¹¦ÄÜ¡£±ÈÈç´«ÈëһЩÊý¾Ý²ÎÊý£¬µ«Ö´ÐеÄSQL¹ý³Ì¿ÉÄܲ»Í¬µÈ¡£
¡¡¡¡ÏÂÃæ¾ÍÀ´¸öÀý× ......
public static void SetEnterControl(System.Web.UI.Control Ctrl)
{
Page mPage = Ctrl.Page;
string mScript;
mScript = @"<script language=""jav ......
ÔÚasp.netÀïÔõô¸ú¾ÝÓû§È¨ÏÞÀ´Éú³ÉÊ÷Ðβ˵¥
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;
......