asp.netСÊýµãËÄÉáÎåÈëµÄ·½·¨
1.Ö»ÒªÇó±£ÁôNλ²»ËÄÉá5Èë
¡¡¡¡float f = 0.55555f£»int i =£¨int£©£¨f * 100£©£»f = £¨float£©£¨i*1.0£©/100£»
¡¡¡¡2.±£ÁôN룬ËÄÉáÎåÈë .
¡¡¡¡decimal d= decimal.Round£¨decimal.Parse£¨"0.55555"£©£¬2£©£»
¡¡¡¡3.±£ÁôNλËÄÉáÎåÈë
¡¡¡¡Math.Round£¨0.55555£¬2£©
¡¡¡¡4£¬±£ÁôNλËÄÉáÎåÈë
¡¡¡¡double dbdata = 0.55555£»string str1 = dbdata.ToString£¨"f2"£©£»//fN ±£ÁôN룬ËÄÉáÎåÈë
¡¡¡¡5.±£ÁôNλËÄÉáÎåÈë
¡¡¡¡string result = String.Format£¨"{0£ºN2}"£¬ 0.55555£©£»//2λ
¡¡¡¡string result = String.Format£¨"{0£ºN3}"£¬ 0.55555£©£»//3λ
¡¡¡¡6. ±£ÁôNλËÄÉáÎåÈë
¡¡¡¡double s=0.55555£»result=s.ToString£¨"#0.00"£©£»//µãºóÃ漸¸ö0¾Í±£Áô¼¸Î»
Ïà¹ØÎĵµ£º
asp.net±éÀúHashTableÐèÒªÓõ½DictionaryEntry Object£¬asp.net±éÀúHashTable£¬¿ÉÒÔͨ¹ýÈçÏÂÁ½ÖÖ·½·¨À´ÊµÏÖ£¬
·½·¨Ò»£º
foreach (System.Collections.DictionaryEntry objDE in objHasTab)
{
Console.WriteLine(objDE.Key.ToString());
Console.WriteLine(objDE.Value.ToString ......
1¡¢<%=%> ÀïÃæ·ÅµÄ±äÁ¿Ãû£¬È磺
<div>
<h1>Hello World</h1>
<p>Welcome to Beginning ASP.NET 3.5 on <%=
DateTime.Now.ToString() %></p>
</div>
Êä³ö½á¹ûΪ£º
Hello World
Welcome to Beginning ASP.NET 3.5 on 2009-11-10 15:53:08
2¡¢ <%#%> ÕâÀïÊÇÊ ......
Ò³Ãæ¼ÓÔØ˳ÐòÈçÏÂ:
Page.Init
Page.Load
Textbox.TextChanged
Button.Click
Page.PreRender
Page.Unload
ÔÚPage.Unload֮ǰ,Ò³Ãæ¾Í³ÊÏÖ³öÀ´ÁË.
page.initÖ»ÊÇÔÚÒ³ÃæµÚÒ»´ÎÔØÈëµÄʱºòÖ´ÐÐ,µ±Ò³Ãæpostbackºó´Ópage.load¿ªÊ¼Ö´ÐÐ.
e.g
<%@ Page Language="C#" AutoEventWireup="true" CodeBe ......
asp.net ¶ÔxmlÎļþµÄ¶Áд,Ìí¼Ó,ÐÞ¸Ä,ɾ³ý²Ù×÷
ÏÂÃæÓдúÂëµ÷ÊÔÕýÈ·
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&nb ......
<%
set conn= server.createobject("ADODB.connection")
conn.open "driver={sybase driver 10};"
"srvr=SYBASE;"
"UID=sa;"
"pwd=sybase;"
sql="select no from tab_st ......