C#ÕýÔò±í´ïʽ±à³Ì£¨¶þ£©£ºRegexÀàÓ÷¨
C#ÕýÔò±í´ïʽ±à³Ì£¨¶þ£©£ºRegexÀàÓ÷¨
¶ÔÓÚÕýÔò±í´ïʽµÄÓ¦Ó㬻ù±¾ÉÏ¿ÉÒÔ·ÖΪÑéÖ¤¡¢ÌáÈ¡¡¢·Ö¸îºÍÌæ»»¡£½ö½öÀûÓÃRegexÀà¾Í¿ÉÒÔʵÏÖÑéÖ¤ºÍ¼òµ¥Ìæ»»¡£
ÀûÓÃRegexÀàʵÏÖÑéÖ¤
¾Àú2009ÄêµÄ±¸°¸ºÍDNSÍ£Ö¹½âÎö·ç²¨Ö®ºó£¬´ó²¿·ÖµÄ´øÓз´À¡ÐÔµÄÍøÕ¾ºÍÂÛ̳¶¼¶ÔһЩÃô¸Ð´Ê½øÐÐÁ˹ýÂË£¬°üº¬ÓÐÕâÀàÃô¸Ð´ÊµÄÎÄÕÂҪôÄÚÈݱ»Ì滻Ҫô±»½ûÖ¹·¢±í£¬ÀûÓÃRegexÀà¾Í¿ÉÒÔʵÏÖÕâ¸ö¹¦ÄÜ£¬ÏÂÃæÊÇÒ»¸öÀý×Ó£º
view plaincopy to clipboardprint?
/// <summary>
/// ¼ì²é×Ö·û´®ÖÐÊÇ·ñÓГËïȨ”Õâ¸öÃô¸Ð´Ê
/// </summary>
public void IsMatchDemo()
{
string source = "Áõ±¸ABC¹ØÓðABcÕÅ·ÉAbcÕÔÔÆabcÖî¸ðÁÁaBCËïȨabCÖÜè¤AbC³ËàaBc²Ü²ÙÐíØü¹ù¼ÎÐè»ÎÔ¬ÉÜ";
Regex regex = new Regex("ËïȨ");
//if (Regex.IsMatch(source, "ËïȨ"))
//ÏÂÃæÕâ¾äºÍÉÏÃæ±»×¢Ê͵ôµÄÒ»¾ä×÷ÓõÄͬÑùµÄ
if (regex.IsMatch(source))
{
Console.WriteLine("×Ö·û´®Öаüº¬ÓÐÃô¸Ð´Ê:ËïȨ£¡");
}
/// <summary>
/// ¼ì²é×Ö·û´®ÖÐÊÇ·ñÓГËïȨ”Õâ¸öÃô¸Ð´Ê
/// </summary>
public void IsMatchDemo()
{
string source = "Áõ±¸ABC¹ØÓðABcÕÅ·ÉAbcÕÔÔÆabcÖî¸ðÁÁaBCËïȨabCÖÜè¤AbC³ËàaBc²Ü²ÙÐíØü¹ù¼ÎÐè»ÎÔ¬ÉÜ";
Regex regex = new Regex("ËïȨ");
//if (Regex.IsMatch(source, "ËïȨ"))
//ÏÂÃæÕâ¾äºÍÉÏÃæ±»×¢Ê͵ôµÄÒ»¾ä×÷ÓõÄͬÑùµÄ
if (regex.IsMatch(source))
{
Console.WriteLine("×Ö·û´®Öаüº¬ÓÐÃô¸Ð´Ê:ËïȨ£¡");
}
Êä³ö½á¹û£º×Ö·û´®Öаüº¬ÓÐÃô¸Ð´Ê:ËïȨ£¡
¶ÔÓÚÉÏÃæµÄÀý×Ó£¬Èç¹ûÒª¼ì²éµÄ×Ö·û´®Öаüº¬“ËïȨ”Õâ¸ö¹Ø¼ü´Ê¾Í»áÔÚ¿ØÖÆ̨ÉÏÊä³öÌáʾ£¬µ±È»ÔÚʵ¼ÊµÄÓ¦ÓÃÖпÉÄÜÊÇ°üº¬Óб»½ûÖ¹µÄ´ÊÓïµÄÄÚÈݲ»ÔÊÐíÌá½»¶ø²»Êǽö½öÌáʾÁË¡£²»¹ýÕâÀàÇé¿öÈ
Ïà¹ØÎĵµ£º
Ö÷Ҫͨ¹ýÐÞ¸Äprogram.csÎļþµÄÄÚÈÝÀ´ÊµÏÖ¡£
Ê×ÏÈÔÚÌí¼Ó¼¸¸öÃû¿Õ¼äµÄÒýÓãº
using System.Diagnostics; //ʹÓÃProcess
using System.Runtime.InteropServices; ......
Èç¹ûÄãµÄ¼òÀúÉÏÃæд“ÊìϤ/Á˽âC#”£¬ÄÇôÄã¾ÍÓ¦¸ÃÄܹ»»Ø´ðÏÂÃæµÄÕâЩ»ù´¡ÎÊÌâ¡£
´«Èëij¸öÊôÐÔµÄset·½·¨µÄÒþº¬²ÎÊýµÄÃû³ÆÊÇʲô£¿
value£¬ËüµÄÀàÐͺÍÊôÐÔËùÉùÃûµÄÀàÐÍÏàͬ¡£
ÈçºÎÔÚC#ÖÐʵÏּ̳У¿
ÔÚÀàÃûºó¼ÓÉÏÒ»¸öðºÅ£¬ÔÙ¼ÓÉÏ»ùÀàµÄÃû³Æ¡£
C#Ö§³Ö¶àÖؼ̳Ðô£¿
²»Ö§³Ö¡£¿ÉÒÔÓýӿÚÀ´ÊµÏÖ¡£
±»protecte ......
private void Create_Pz(string Sourcename)
{
string OutMsg;
SqlParameter[] sortPara = { new SqlParameter("@ps_IsType", Pz ......
½üÀ´ORM±äµÃÔ½À´Ô½Æձ飬Õⶼ¹éÓÚÒ»Öֺܾß˵·þÁ¦µÄÔÒò£»Ëü¿ÉÒÔʹ¿ª·¢Êý¾Ý¿âÇý¶¯µÄÓ¦ÓóÌÐò±äµÃ¸ü¿ì¡¢¸üÊ¡Á¦¡£µ«ÊÇORM¿ò¼Ü¶¼Óе㓹ÌÖ´¼º¼û”£¬ËûÃÇÆÚÍû¿ª·¢Õß×ñ´ÓÌض¨µÄ¹æÔò£¬µ±¹æÔò±»´òÆƵÄʱºò¾Í·Ç³£ÄÑÒÔʹÓá£×îͨ³£µÄ¹æÔòÖ®Ò»¾ÍÊÇ£¬´æ´¢¹ý³Ì±ØÐë×ÜÊÇ·µ»Øµ¥¶ÀµÄ½á¹û¼¯£¬ÆäÖд ......
²âÊÔÓï·¨¸ßÁÁµÄ C# ´úÂëµÄ html fragment Éú³É:
ÓÃcsdn blog API ·¢²¼.
ÏÂÃæÊÇ:
public class HtmlWriter
{
static Dictionary _colors;
static int _colorNum;
static StringBuilder _colorString;