02 2013 档案
摘要:1.首先引入命名空间using System.Text.RegularExpressions;2.定义正则验证方法 //str是要被验证的字符串,regexStr为正则表达式 public static bool GetRegexInput(string str, string regexStr) { Regex rStr = new Regex(regexStr); bool bResult = false; if (rStr.IsMatch(str)) { bResult = true; } return bResult; } 3.测试注册密码格式(至少为6位,由非纯数字或字母组成) //
阅读全文
摘要:/// <summary> /// WPF中查找元素的父元素 /// </summary> /// <typeparam name="T"></typeparam> /// <param name="i_dp"></param> /// <returns></returns> public static T FindParent<T>(DependencyObject i_dp) where T : DependencyObject { Depen
阅读全文