ʹÓÃC#ÕýÔò±í´ïʽƥÅäÏà¹Ø×Ö·û´®
C#ÕýÔò±í´ïʽƥÅä×Ö·û´®µÄ·½·¨ÈçÏ£º
1.ʹÓÃC#ÖÐʹÓÃÕýÔò±í´ïʽSystem.Text.RegularExpressionsÃüÃû¿Õ¼ä£»
2.ʹÓÃC#ÖÐʹÓÃÕýÔò±í´ïʽMatches()·½·¨Æ¥Åä×Ö·û´®£¬¸ñʽÈçÏ£º
MatchCollection Matches = Regex.Matches(Str, Pattern, RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture);
ÆäÖÐStr±íʾÊäÈë×Ö·û´®£¬Pattern±íʾƥÅäģʽ£¬RegexOptions.IgnoreCase±íʾºöÂÔ´óСд£¬RegexOptions.ExplicitCapture±íʾ¸Ä±äÊÕ¼¯Æ¥Å䷽ʽ¡£
3.Æ¥Åä½á¹û±£´æÔÚMatchCollection¼¯ºÏÖУ¬¿ÉÒÔͨ¹ýÑ»·±éÀú½á¹û¼¯È¡³öMatch¶ÔÏóµÄ½á¹û¡£
TestRagular.cs:
using System;
using System.Text.RegularExpressions;
namespace Magci.Test.Strings
{
public class TestRegular
{
public static void WriteMatches(string str, MatchCollection matches)
{
Console.WriteLine("\nString is : " + str);
Console.WriteLine("No. of matches : " + matches.Count);
foreach (Match nextMatch in matches)
{
//È¡³öÆ¥Åä×Ö·û´®ºÍ×î¶à10¸öÍâΧ×Ö·û
int Index = nextMatch.Index;
string result = nextMatch.ToString();
&
Ïà¹ØÎĵµ£º
//TransmitFileʵÏÖÏÂÔØ
protected void Button1_Click(object sender, EventArgs e)
{
/*
΢ÈíΪResponse¶ÔÏóÌṩÁËÒ»¸öеķ½·¨TransmitFileÀ´½â¾öʹÓÃRespo ......
ÀûÓÃWM_COPYDATAÔÚÓ¦ÓóÌÐò¼ä´«µÝÊý¾ÝºÜ¼òµ¥,¿ªÏúҲС
Ò»¡¢´«µÝÊý¾Ý²¿·Ö
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
using System.Windows.Forms;
namespace ThreeTorches
{
public struct Copydatastru ......
C#ÀࣺÀàÊÇC# Öй¦ÄÜ×îΪǿ´óµÄÊý¾ÝÀàÐÍ£¬ÀàÒ²¶¨ÒåÁËÊý¾ÝÀàÐ͵ÄÊý¾ÝºÍÐÐΪ¡£È»ºó£¬³ÌÐòÔ±¿ÉÒÔ´´½¨×÷Ϊ´ËÀàµÄʵÀýµÄ¶ÔÏó¡£
C#½á¹¹Ì壺½á¹¹ÌåÊÇÇáÁ¿Ð͵ÄÀ࣬ʹÓÿªÏúÏà¶ÔÓÚÀà½ÏС¡£
C#ÀàºÍC#½á¹¹ÌåÁ½ÕߵĹØϵ£º
1.Êý¾ÝÀàÐÍ£ºÀàºÍ½á¹¹Ì嶼ÊÇÊý¾ÝÀàÐÍ£¬ÀàÊÇÒýÓÃÀàÐÍ£¬½á¹¹ÌåÊÇÖµÀàÐÍ¡£
2.¼Ì³ÐÐÔ£ºÀà¿ÉÒԼ̳кͱ»¼Ì³Ð£¬¶ø½á¹ ......
¶ÔÓÚ¶à̬£¬»¹±ØÐèÌáÒ»¸öC#ÖеĹؼü×Ö£ºnew¡£Ç°ÃæÌáµ½£¬¶ÔÓÚvirtual·½·¨£¬JIT»áÈ·¶¨ÊµÀýµÄʵ¼ÊÀàÐÍÈ»ºó¾ö¶¨µ÷ÓÃʲô·½·¨¡£µ«ÊÇÈç¹ûÅÉÉúÀàÖÐnew¹Ø¼ü×ÖÐÞÊη½·¨£¬ÔòËüÏòCLR³ÎÇå´ËÅÉÉúÀàÖеķ½·¨Óë»ùÀàÖеķ½·¨ºÁÎÞ¹Øϵ£¬ÒÔÏ´úÂë×îÖÕµ÷ÓÃÊÇ»ùÀàµÄintroduce·½·¨£º
Code
class Program
{
static vo ......
asp.netĬÈϵıàÂëÊÇUTF-8
jsÎļþÀïµÄ±àÂëÒ²ÊÇUTF-8
µ±ÄãÒªÔÚaspxÒ³ÃæÉϽøÐд«ÖÐÎIJÎÊýʱ»á³öÏÖÂÒÂë
<-----request.aspx--½ÓÊÕ²ÎÊýÒ³----->
<----response.aspx--´«ËͲÎÊýÒ³----->
ÀýÒ»£º<a href="request.aspx?str=ÖйúÈË"></a>
½â¾ö°ì·¨Ò»£º
1.¿ÉÒԺ͸ÄwebconfigµÄ±àÂë È磺
  ......