| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- using System.Text.RegularExpressions;
- namespace DeviceCenter
- {
- class AcsUtil
- {
- public static string getCardNo(string input)
- {
- string pattern = @"\+Card Number\:(\d+)\+";
- try
- {
- return Regex.Matches(input, pattern)[0].Groups[1].Value;
- }
- catch
- {
- return null;
- }
- }
- public static string getDoorNo(string input)
- {
- string pattern = @"\+Door Number\:(\d+)\+";
- try
- {
- return Regex.Matches(input, pattern)[0].Groups[1].Value;
- }
- catch
- {
- return null;
- }
- }
- public static string getChannel(string input)
- {
- string pattern = @"\+wAccessChannel\:(\d+)\+";
- try
- {
- return Regex.Matches(input, pattern)[0].Groups[1].Value;
- }
- catch
- {
- return null;
- }
- }
- public static string getCardReaderNo(string input)
- {
- string pattern = @"\+Card Reader Number\:(\d+)\+";
- try
- {
- return Regex.Matches(input, pattern)[0].Groups[1].Value;
- }
- catch
- {
- return null;
- }
- }
- public static string getPicturePath(string input)
- {
- string pattern = @"SavePath\:(.+\.bmp)";
- try
- {
- return Regex.Matches(input, pattern)[0].Groups[1].Value;
- }
- catch
- {
- return null;
- }
- }
- }
- }
|