Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ASP.NET(C#)·µ»ØÉÏÒ»Ò³(ºóÍË)´úÂë

protected void Page_Load(object sender, EventArgs e)
{
    if (!IsPostBack)
    {
        ViewState["BackUrl"] = Request.UrlReferrer.ToString();
    }
}
/// <summary>
/// ·µ»Ø°´Å¥µã»÷ʼþ
/// </summary>
protected void Button1_Click(object sender, EventArgs e)
{
    Response.Redirect(ViewState["BackUrl"].ToString());
}
ÁíÒ»ÖÖ·½·¨
ÔÚC# Web³ÌÐòÖУ¬ÈçΪҳÃ水ťд·µ»ØÉÏÒ»Ò³´úÂë
this.RegisterClientScriptBlock("E", "<script language=javascript>history.go(-2);</script>");
ÆäÖУ¬history.go(-2)£¬ÒªÐ´Îª-2£¬ÒòÔÚ°´Å¥Ê¼þ´¥·¢Ç°£¬ÒÑË¢ÐÂÒ»´ÎÒ³Ã棬ËùÒÔÓ¦ÊÇ-2¡£
Response.Write("<script language=javascript>history.go(-2);</script>");
´Ë´¦Ò²ÒªÐ´Îª“-2”¡£¸úÖ±½Óд½Å±¾µÄÓÐËù²»Í¬¡£


Ïà¹ØÎĵµ£º

C#ÖÐrefºÍoutµÄÇø±ð

¿´Á˺ܶà.°´ÕÕ ×Ô¼ºÃ÷°×½âÊÍһϠ.NET RefºÍOut¹Ø¼ü×Ö ¶ÔÓÚÖµÀàÐÍ¡£ Èç¹û²»Ê¹ÓÃref /outÔò´«µÝµÄÖ»ÊÇÕâЩֵµÄCOPY, ʹÓÃÁËRefºÍOutµÄЧ¹û¾Í¼¸ºõºÍCÖÐʹÓÃÁËÖ¸Õë±äÁ¿Ò»Ñù¡£(´«µÝµÄ¾ÍÊÇÔ­Öµ),ËüÄܹ»ÈÃÄãÖ±½Ó¶ÔÔ­Êý½øÐвÙ×÷£¬¶ø²»ÊǶÔÄǸöÔ­ÊýµÄCopy½øÐвÙ×÷ ¶ÔÓÚÒýÓÃÀàÐÍ: Èç¹û²»Ê¹ÓÃref /out,ÒòΪ´«µÝµÄÊÇÒýÓÃÀàÐ͵ĵØÖ·Öµ,Ô ......

c# String[1].Format¸ñʽ˵Ã÷

C#¸ñʽ»¯ÊýÖµ½á¹û±í
×Ö·û
˵Ã÷
ʾÀý
Êä³ö
C
»õ±Ò
string.Format("{0:C3}", 2)
¡ç2.000
D
Ê®½øÖÆ
string.Format("{0:D3}", 2)
002
E
¿Æѧ¼ÆÊý·¨
1.20E+001
1.20E+001
G
³£¹æ
string.Format("{0:G}", 2)
2
N
Ó÷ֺŸô¿ªµÄÊý×Ö
string.Format("{0:N}", 250000)
250,000.00
X
Ê®Áù½øÖÆ
string.Forma ......

C#ÏòExcel±¨±íÖвåÈëͼƬµÄ2ÖÖ·½·¨

Ò»¡¢²åͼµÄÀࣨº¬2·½·¨£©
1using System;
2using System.Collections.Generic;
3using System.Text;
4//using Excel = Microsoft.Office.Interop.Excel;
5using Excel;
6using System.Windows.Forms;
7
8
9namespace ExcelReport
10{
11 class InsertPicToExcel
12 {
13 / ......

WriteXmlÀà(C#)

using System;
using System.Web;
using System.Data;
using System.Text;
using System.Xml;
using System.IO;
namespace Baolee.GeneralMethod
{
 /// <summary>
 /// WriteXml µÄժҪ˵Ã÷¡£
 /// </summary>
 public class WriteXml
 {
  /// <summary>
......

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;
using System.IO;
using System.Text;
names ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ