• λ我爱Aspx >> Asp.Net >> C#正则表达式应用范例
  • C#正则表达式应用范例

  • :未知  Դ:internet  :2007-5-20 16:44:08  ؼ:c#
  • The following example shows the use of Regular Expresssions in C#.This program has basic validation scripts for validation easily useable in all programs.

    /*

    <HowToCompile>

    csc /r:System.Text.RegularExpressions.dll,System.dll Validation.cs

    </HowToComplie>

    */

    using System.Text.RegularExpressions;

    using System;

    class Validation

    {

    public static void Main()

    {

    String strToTest;

    Validation objValidate=new Validation();

    Console.Write("Enter a String to Test for Alphabets:");

    strToTest=Console.ReadLine();

    if(objValidate.IsAlpha(strToTest))

    {

    Console.WriteLine("{0} is Valid Alpha String",strToTest);

    }

    else

    {

    Console.WriteLine("{0} is not a Valid Alpha String",strToTest);

    }

    }

    // Function to test for Positive Integers.

    Ҷƪл˵?
  • һƪ使用C# 编写扩展存储过程
    һƪASP生成静态网页的方法